Conversation
reportable lowState for battery modernExtent
YNDX-00530
src/devices/yandex.ts
Outdated
| }, | ||
| entityCategory: "config", | ||
| }), | ||
| m.reportAttribute({ |
There was a problem hiding this comment.
Is this not already done with:
m.light({
effect: true,
powerOnBehavior: true,
configureReporting: true,
}),There was a problem hiding this comment.
No. The default minimum period in the report is 10 seconds, and here I change it to the minimum.
There was a problem hiding this comment.
If I add reporting parameters for each attribute to m.light, the code will grow. Therefore, I decided to make a universal reporting that can be used in various cases.
There was a problem hiding this comment.
I think it is nicer to put it in m.light, in this was you don't need to look in multiple places for the config (and also the execution order is not guaranteed)
src/lib/modernExtend.ts
Outdated
| endpointNames?: string[]; | ||
| ota?: ModernExtend["ota"]; | ||
| levelConfig?: {disabledFeatures?: LevelConfigFeatures}; | ||
| levelConfigureReporting?: ReportingConfigWithoutAttribute; |
There was a problem hiding this comment.
| levelConfigureReporting?: ReportingConfigWithoutAttribute; | |
| levelReportingConfig?: ReportingConfigWithoutAttribute; |
src/lib/modernExtend.ts
Outdated
| await setupAttributes(device, coordinatorEndpoint, "genOnOff", [{attribute: "onOff", min: "MIN", max: "MAX", change: 1}]); | ||
| await setupAttributes(device, coordinatorEndpoint, "genLevelCtrl", [ | ||
| {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1}, | ||
| {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1, ...args.levelConfigureReporting}, |
There was a problem hiding this comment.
...args.levelConfigureReporting fails if args.levelConfigureReporting if null
| {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1, ...args.levelConfigureReporting}, | |
| {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1, ...(args.levelConfigureReporting ?? {})}, |
|
Thanks! |
No description provided.