Skip to content

Commit d101973

Browse files
canardosKoenkk
andauthored
fix: Add label to modern extends binary function (#8943)
Co-authored-by: Koen Kanters <[email protected]>
1 parent 253eced commit d101973

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/modernExtend.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2387,15 +2387,17 @@ export interface BinaryArgs {
23872387
endpointName?: string;
23882388
reporting?: false | ReportingConfig;
23892389
access?: "STATE" | "STATE_GET" | "STATE_SET" | "SET" | "ALL";
2390+
label?: string;
23902391
entityCategory?: "config" | "diagnostic";
23912392
}
23922393
export function binary(args: BinaryArgs): ModernExtend {
2393-
const {name, valueOn, valueOff, cluster, attribute, description, zigbeeCommandOptions, endpointName, reporting, entityCategory} = args;
2394+
const {name, valueOn, valueOff, cluster, attribute, description, zigbeeCommandOptions, endpointName, reporting, label, entityCategory} = args;
23942395
const attributeKey = isString(attribute) ? attribute : attribute.ID;
23952396
const access = ea[args.access ?? "ALL"];
23962397

23972398
let expose = e.binary(name, access, valueOn[0], valueOff[0]).withDescription(description);
23982399
if (endpointName) expose = expose.withEndpoint(endpointName);
2400+
if (label) expose = expose.withLabel(label);
23992401
if (entityCategory) expose = expose.withCategory(entityCategory);
24002402

24012403
const fromZigbee: Fz.Converter[] = [

0 commit comments

Comments
 (0)