-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reportAttribute modernExtend #8965
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,6 +327,7 @@ export interface BatteryArgs { | |
percentageReporting?: boolean; | ||
voltageReportingConfig?: ReportingConfigWithoutAttribute; | ||
voltageReporting?: boolean; | ||
lowStatusReportingConfig?: ReportingConfigWithoutAttribute; | ||
} | ||
export function battery(args?: BatteryArgs): ModernExtend { | ||
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress` | ||
|
@@ -454,6 +455,12 @@ export function battery(args?: BatteryArgs): ModernExtend { | |
result.meta = meta; | ||
} | ||
|
||
if (args.lowStatusReportingConfig) { | ||
const configure: Configure[] = result.configure || []; | ||
configure.push(setupConfigureForReporting("genPowerCfg", "batteryAlarmState", args.lowStatusReportingConfig, ea.STATE_GET)); | ||
result.configure = configure; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
|
@@ -2686,4 +2693,17 @@ export function bindCluster(args: {cluster: string | number; clusterType: "input | |
return {configure, isModernExtend: true}; | ||
} | ||
|
||
export function reportAttribute(args: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is used? Please remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. currently not used, but can be used along with/like bindCluster modernExtend https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/lib/modernExtend.ts#L2684C17 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is not used than I propose to remove it for now. |
||
cluster: string | number; | ||
attribute: ReportingConfigAttribute; | ||
config: ReportingConfigWithoutAttribute; | ||
access?: Access; | ||
endpointNames?: string[]; | ||
}): ModernExtend { | ||
const configure: Configure[] = [ | ||
setupConfigureForReporting(args.cluster, args.attribute, args.config, args.access || ea.STATE_GET, args.endpointNames), | ||
]; | ||
return {configure, isModernExtend: true}; | ||
} | ||
|
||
// #endregion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to prevent creating a configure here and under
percentageReporting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done