@zwave-js/cc 15.18.0 → 15.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AssociationGroupInfoCC.js +1 -1
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.js +2 -2
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.js +2 -2
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.js +1 -1
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.js +2 -2
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.js +3 -2
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.js +1 -1
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.js +1 -1
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.js +3 -3
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.js +6 -6
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.js +6 -6
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js +4 -4
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.js +6 -6
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.js +3 -3
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.js +4 -4
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.js +7 -7
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.js +5 -5
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +11 -1
- package/build/cjs/cc/SoundSwitchCC.js +34 -5
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.js +5 -5
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.js +2 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.js +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.js +4 -4
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.js +2 -2
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.js +54 -39
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.js +1 -1
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.js +8 -8
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/lib/API.d.ts +2 -2
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.js +2 -2
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.js +2 -2
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/cjs/lib/Values.js.map +1 -1
- package/build/cjs/lib/traits.d.ts +9 -0
- package/build/cjs/lib/utils.d.ts +7 -1
- package/build/cjs/lib/utils.js +21 -17
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AssociationGroupInfoCC.js +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -2
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -2
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +3 -2
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +1 -1
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +3 -3
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.js +6 -6
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/MeterCC.js +6 -6
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +4 -4
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +6 -6
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -2
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.js +3 -3
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +4 -4
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +7 -7
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +5 -5
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +11 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +34 -5
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +5 -5
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -2
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +3 -3
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +4 -4
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -2
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +80 -43
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +1 -1
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +8 -8
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js +0 -1
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +2 -2
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.js +2 -2
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/Security2/Extension.js +2 -2
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/Values.js +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/traits.d.ts +9 -0
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.d.ts +7 -1
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js +25 -21
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/Values.ts"],
|
|
4
|
-
"sourcesContent": ["import type { GetDeviceConfig } from \"@zwave-js/config\";\nimport type {\n\tCommandClasses,\n\tEndpointId,\n\tGetValueDB,\n\tValueID,\n\tValueMetadata,\n} from \"@zwave-js/core\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared\";\nimport type { ValueIDProperties } from \"./API.js\";\n\nimport { CCValues } from \"../cc/_CCValues.generated.js\";\n\nfunction defineCCValues<T extends CommandClasses>(\n\tcommandClass: T,\n\t_: Record<string, CCValueBlueprint | DynamicCCValueBlueprint<any[]>>,\n\t//
|
|
4
|
+
"sourcesContent": ["import type { GetDeviceConfig } from \"@zwave-js/config\";\nimport type {\n\tCommandClasses,\n\tEndpointId,\n\tGetValueDB,\n\tValueID,\n\tValueMetadata,\n} from \"@zwave-js/core\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared\";\nimport type { ValueIDProperties } from \"./API.js\";\n\nimport { CCValues } from \"../cc/_CCValues.generated.js\";\n\nfunction defineCCValues<T extends CommandClasses>(\n\tcommandClass: T,\n\t_: Record<string, CCValueBlueprint | DynamicCCValueBlueprint<any[]>>,\n\t// oxlint-disable-next-line typescript/ban-ts-comment\n\t// @ts-ignore I know what I'm doing!\n): typeof import(\"../cc/_CCValues.generated.js\").CCValues[T] {\n\t// oxlint-disable-next-line typescript/ban-ts-comment\n\t// @ts-ignore I know what I'm doing!\n\treturn CCValues[commandClass];\n}\n\n// HINT: To fully view types for definitions created by this, open\n// node_modules/typescript/lib/tsserver.js and change the definition of\n// ts.defaultMaximumTruncationLength = 160\n// to something higher like\n// ts.defaultMaximumTruncationLength = 1000\n// Then restart TS Server\n\nexport interface CCValueOptions {\n\t/**\n\t * Whether the CC value is internal. Internal values are not exposed to the user.\n\t */\n\tinternal?: boolean;\n\t/**\n\t * The minimum CC version required for this value to exist.\n\t */\n\tminVersion?: number;\n\t/**\n\t * Whether this value represents a state (`true`) or a notification/event (`false`). Default: `true`\n\t */\n\tstateful?: boolean;\n\t/**\n\t * Omit this value from value logs. Default: `false`\n\t */\n\tsecret?: boolean;\n\n\t/** Whether the CC value may exist on endpoints. Default: `true` */\n\tsupportsEndpoints?: boolean;\n\n\t/**\n\t * Can be used to dynamically decide if this value should be created automatically.\n\t * This is ignored for dynamic values and defaults to `true` if not given.\n\t */\n\tautoCreate?:\n\t\t| boolean\n\t\t| ((\n\t\t\tctx: GetValueDB & GetDeviceConfig,\n\t\t\tendpoint: EndpointId,\n\t\t) => boolean);\n}\n\nexport const defaultCCValueOptions = {\n\tinternal: false,\n\tminVersion: 1,\n\tsecret: false,\n\tstateful: true,\n\tsupportsEndpoints: true,\n\tautoCreate: true,\n} as const;\n\n// expands object types recursively\nexport type ExpandRecursively<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursively<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursively<T[P]>;\n\t\t\t}\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\nexport type ExpandRecursivelySkipMeta<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never]\n\t\t\t? (...args: A) => ExpandRecursivelySkipMeta<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursivelySkipMeta<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursivelySkipMeta<T[P]>;\n\t\t\t}\n\t\t// Ignore the ValueMetadata type\n\t\t: T extends ValueMetadata ? T\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O\n\t\t\t\t? { [K in keyof O]: ExpandRecursivelySkipMeta<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\ntype InferArgs<T extends FnOrStatic<any, any>[]> = T extends [\n\t(...args: infer A) => any,\n\t...any,\n] ? A\n\t: T extends [any, ...infer R] ? InferArgs<R>\n\t: [];\n\n// Namespace for utilities to define CC values\nexport const V = {\n\t/** Returns a CC value definition that is named like the value `property` */\n\tstaticProperty<\n\t\tTProp extends string | number,\n\t\tconst TMeta extends ValueMetadata,\n\t\tconst TOptions extends CCValueOptions,\n\t>(\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TProp]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[property]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and `property` */\n\tstaticPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tconst TMeta extends ValueMetadata,\n\t\tconst TOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name, `property` and `propertyKey` */\n\tstaticPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTKey extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tpropertyKey: TKey;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends CCValueOptions = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: InferArgs<[TProp, TMeta]>) => ({\n\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t}),\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTKey extends FnOrStatic<any[], ValueIDProperties[\"propertyKey\"]>,\n\t\tTOptions extends CCValueOptions,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TKey, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tpropertyKey: ReturnTypeOrStatic<TKey>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: any[]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\t\tpropertyKey: evalOrStatic(propertyKey, ...args),\n\t\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\tdefineCCValues,\n};\n\nexport interface CCValueBlueprint extends Readonly<ValueIDProperties> {\n\treadonly meta?: Readonly<ValueMetadata>;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\nexport type CCValuePredicate = (valueId: ValueID) => boolean;\nexport type PartialCCValuePredicate = (\n\tproperties: ValueIDProperties,\n) => boolean;\n\n/** A blueprint for a CC value which depends on one or more parameters */\nexport interface DynamicCCValueBlueprint<TArgs extends any[]> {\n\t(...args: TArgs): Omit<CCValueBlueprint, \"options\">;\n\tis: PartialCCValuePredicate;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\n/** The common base type of all CC value definitions */\nexport interface CCValue {\n\treadonly id: Omit<ValueID, \"endpoint\">;\n\tendpoint(endpoint?: number): ValueID;\n\treadonly meta: ValueMetadata;\n}\n\nexport interface StaticCCValue extends CCValue {\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\treadonly options: Required<CCValueOptions>;\n}\n\nexport type DynamicCCValue<TArgs extends any[] = any[]> =\n\t& ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue>\n\t& {\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\t\treadonly options: Required<CCValueOptions>;\n\t};\n\nexport type StaticCCValueFactory<T> = (self: T) => StaticCCValue;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAQA;;;;;;AAAA,oBAIO;AAGP,gCAAyB;AAEzB,SAAS,eACR,cACA,GAAoE;AAMpE,SAAO,mCAAS,YAAY;AAC7B;AATS;AAmDF,MAAM,wBAAwB;EACpC,UAAU;EACV,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,mBAAmB;EACnB,YAAY;;AAgDN,MAAM,IAAI;;EAEhB,eAKC,UACA,MACA,SAAkB;AAQlB,WAAO;MACN,CAAC,QAAQ,GAAG;QACX;QACA;QACA;;;EAGH;;EAGA,uBAMC,MACA,UACA,MACA,SAAkB;AAQlB,WAAO;MACN,CAAC,IAAI,GAAG;QACP;QACA;QACA;;;EAGH;;EAGA,6BAOC,MACA,UACA,aACA,MACA,SAAkB;AASlB,WAAO;MACN,CAAC,IAAI,GAAG;QACP;QACA;QACA;QACA;;;EAGH;;EAGA,wBAMC,MACA,UACA,IACA,MACA,SAAkB;AAWlB,WAAO;MACN,CAAC,IAAI,GAAG,OAAO,OACd,IAAI,UAAqC;QACxC,cAAU,4BAAa,UAAU,GAAG,IAAI;QACxC,UAAM,4BAAa,MAAM,GAAG,IAAI;UAEjC,EAAE,IAAI,QAAO,CAAE;;EAGlB;;EAGA,8BAOC,MACA,UACA,aACA,IACA,MACA,SAAkB;AAYlB,WAAO;MACN,CAAC,IAAI,GAAG,OAAO,OACd,IAAI,SAAe;AAClB,eAAO;UACN,cAAU,4BAAa,UAAU,GAAG,IAAI;UACxC,iBAAa,4BAAa,aAAa,GAAG,IAAI;UAC9C,UAAM,4BAAa,MAAM,GAAG,IAAI;;MAElC,GACA,EAAE,IAAI,QAAO,CAAE;;EAGlB;EAEA;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -55,6 +55,15 @@ export interface UserPreferences {
|
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
57
|
scales: Partial<Record<string | number, string | number>>;
|
|
58
|
+
/**
|
|
59
|
+
* When enabled, notification events that include a user ID (like `Keypad unlock operation`)
|
|
60
|
+
* will be enriched with the corresponding user code status and user code (if available).
|
|
61
|
+
*
|
|
62
|
+
* **WARNING:** User codes are sensitive information. Take care not to log or expose them unintentionally.
|
|
63
|
+
*
|
|
64
|
+
* Default: `false`
|
|
65
|
+
*/
|
|
66
|
+
lookupUserIdInNotificationEvents?: boolean;
|
|
58
67
|
}
|
|
59
68
|
/** Allows reading user preferences */
|
|
60
69
|
export interface GetUserPreferences {
|
package/build/cjs/lib/utils.d.ts
CHANGED
|
@@ -8,7 +8,13 @@ export declare function getAllAssociations(ctx: GetValueDB, node: NodeId & GetAl
|
|
|
8
8
|
export declare function checkAssociation(ctx: HostIDs & GetValueDB & GetNode<NodeId & SupportsCC & GetEndpoint<EndpointId & SupportsCC> & QuerySecurityClasses>, endpoint: EndpointId & SupportsCC & ControlsCC, group: number, destination: AssociationAddress): AssociationCheckResult;
|
|
9
9
|
export declare function getAssociationGroups(ctx: GetValueDB & GetDeviceConfig, endpoint: EndpointId & SupportsCC): ReadonlyMap<number, AssociationGroup>;
|
|
10
10
|
export declare function getAllAssociationGroups(ctx: GetValueDB & GetDeviceConfig, node: NodeId & GetAllEndpoints<EndpointId & SupportsCC>): ReadonlyMap<number, ReadonlyMap<number, AssociationGroup>>;
|
|
11
|
-
export declare function addAssociations(ctx: CCAPIHost<CCAPINode & SupportsCC & GetEndpoint<EndpointId & SupportsCC> & QuerySecurityClasses>, endpoint: EndpointId & SupportsCC & ControlsCC, group: number, destinations: AssociationAddress[]
|
|
11
|
+
export declare function addAssociations(ctx: CCAPIHost<CCAPINode & SupportsCC & GetEndpoint<EndpointId & SupportsCC> & QuerySecurityClasses>, endpoint: EndpointId & SupportsCC & ControlsCC, group: number, destinations: AssociationAddress[], options?: {
|
|
12
|
+
/**
|
|
13
|
+
* Whether to force creating associations even if they are not allowed.
|
|
14
|
+
* **Note:** Invalid associations will most likely not work
|
|
15
|
+
*/
|
|
16
|
+
force?: boolean;
|
|
17
|
+
}): Promise<void>;
|
|
12
18
|
export declare function removeAssociations(ctx: CCAPIHost, endpoint: EndpointId & SupportsCC & ControlsCC, group: number, destinations: AssociationAddress[]): Promise<void>;
|
|
13
19
|
export declare function getLifelineGroupIds(ctx: GetValueDB & GetDeviceConfig, endpoint: EndpointId & SupportsCC): number[];
|
|
14
20
|
export declare function configureLifelineAssociations(ctx: CCAPIHost<CCAPINode & SupportsCC & ControlsCC & GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>>, endpoint: EndpointId & SupportsCC & ControlsCC): Promise<void>;
|
package/build/cjs/lib/utils.js
CHANGED
|
@@ -199,7 +199,7 @@ function getAllAssociationGroups(ctx, node) {
|
|
|
199
199
|
return ret;
|
|
200
200
|
}
|
|
201
201
|
__name(getAllAssociationGroups, "getAllAssociationGroups");
|
|
202
|
-
async function addAssociations(ctx, endpoint, group, destinations) {
|
|
202
|
+
async function addAssociations(ctx, endpoint, group, destinations, options) {
|
|
203
203
|
const nodeAndEndpointString = `${endpoint.nodeId}${endpoint.index > 0 ? `, endpoint ${endpoint.index}` : ""}`;
|
|
204
204
|
let assocInstance;
|
|
205
205
|
let mcInstance;
|
|
@@ -231,15 +231,17 @@ async function addAssociations(ctx, endpoint, group, destinations) {
|
|
|
231
231
|
const deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);
|
|
232
232
|
const groupIsMultiChannel = !!mcInstance && group <= mcGroupCount && deviceConfig?.associations?.get(group)?.multiChannel !== false;
|
|
233
233
|
if (groupIsMultiChannel) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
if (!options?.force) {
|
|
235
|
+
const disallowedAssociations = destinations.map((a) => ({
|
|
236
|
+
...a,
|
|
237
|
+
checkResult: checkAssociation(ctx, endpoint, group, a)
|
|
238
|
+
})).filter(({ checkResult }) => checkResult !== import_Types.AssociationCheckResult.OK);
|
|
239
|
+
if (disallowedAssociations.length) {
|
|
240
|
+
let message = `The following associations are not allowed:`;
|
|
241
|
+
message += disallowedAssociations.map((a) => `
|
|
241
242
|
\xB7 Node ${a.nodeId}${a.endpoint ? `, endpoint ${a.endpoint}` : ""}: ${(0, import_shared.getEnumMemberName)(import_Types.AssociationCheckResult, a.checkResult).replace("Forbidden_", "")}`).join("");
|
|
242
|
-
|
|
243
|
+
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.AssociationCC_NotAllowed, disallowedAssociations);
|
|
244
|
+
}
|
|
243
245
|
}
|
|
244
246
|
const api = import_API.CCAPI.create(import_core.CommandClasses["Multi Channel Association"], ctx, endpoint);
|
|
245
247
|
await api.addDestinations({
|
|
@@ -252,15 +254,17 @@ async function addAssociations(ctx, endpoint, group, destinations) {
|
|
|
252
254
|
if (destinations.some((a) => a.endpoint != void 0)) {
|
|
253
255
|
throw new import_core.ZWaveError(`Node ${nodeAndEndpointString}, group ${group} does not support multi channel associations!`, import_core.ZWaveErrorCodes.CC_NotSupported);
|
|
254
256
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
if (!options?.force) {
|
|
258
|
+
const disallowedAssociations = destinations.map((a) => ({
|
|
259
|
+
...a,
|
|
260
|
+
checkResult: checkAssociation(ctx, endpoint, group, a)
|
|
261
|
+
})).filter(({ checkResult }) => checkResult !== import_Types.AssociationCheckResult.OK);
|
|
262
|
+
if (disallowedAssociations.length) {
|
|
263
|
+
let message = `The associations to the following nodes are not allowed`;
|
|
264
|
+
message += disallowedAssociations.map((a) => `
|
|
262
265
|
\xB7 Node ${a.nodeId}: ${(0, import_shared.getEnumMemberName)(import_Types.AssociationCheckResult, a.checkResult).replace("Forbidden_", "")}`).join("");
|
|
263
|
-
|
|
266
|
+
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.AssociationCC_NotAllowed, disallowedAssociations);
|
|
267
|
+
}
|
|
264
268
|
}
|
|
265
269
|
const api = import_API.CCAPI.create(import_core.CommandClasses.Association, ctx, endpoint);
|
|
266
270
|
await api.addNodeIds(group, ...destinations.map((a) => a.nodeId));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import type { AssociationConfig, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype EndpointId,\n\ttype GetAllEndpoints,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype MaybeNotKnown,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype QuerySecurityClasses,\n\tSecurityClass,\n\ttype SupportsCC,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tactuatorCCs,\n\tgetCCName,\n\tisActuatorCC,\n\tisLongRangeNodeId,\n\tisSensorCC,\n} from \"@zwave-js/core\";\nimport {\n\tObjectKeyMap,\n\ttype ReadonlyObjectKeyMap,\n\tgetEnumMemberName,\n} from \"@zwave-js/shared\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { AssociationCC, AssociationCCValues } from \"../cc/AssociationCC.js\";\nimport { AssociationGroupInfoCC } from \"../cc/AssociationGroupInfoCC.js\";\nimport { MultiChannelAssociationCC } from \"../cc/MultiChannelAssociationCC.js\";\nimport { CCAPI, type CCAPIHost, type CCAPINode } from \"./API.js\";\nimport {\n\ttype AssociationAddress,\n\tAssociationCheckResult,\n\ttype AssociationGroup,\n\tAssociationGroupInfoProfile,\n\ttype EndpointAddress,\n} from \"./_Types.js\";\n\nexport function getAssociations(\n\tctx: GetValueDB,\n\tendpoint: EndpointId & SupportsCC,\n): ReadonlyMap<number, readonly AssociationAddress[]> {\n\tconst ret = new Map<number, readonly AssociationAddress[]>();\n\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tconst destinations = AssociationCC.getAllDestinationsCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (const [groupId, assocs] of destinations) {\n\t\t\tret.set(groupId, assocs);\n\t\t}\n\t} else {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Merge the \"normal\" destinations with multi channel destinations\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tconst destinations = MultiChannelAssociationCC.getAllDestinationsCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (const [groupId, assocs] of destinations) {\n\t\t\tif (ret.has(groupId)) {\n\t\t\t\tconst normalAssociations = ret.get(groupId)!;\n\t\t\t\tret.set(groupId, [\n\t\t\t\t\t...normalAssociations,\n\t\t\t\t\t// Eliminate potential duplicates\n\t\t\t\t\t...assocs.filter(\n\t\t\t\t\t\t(a1) =>\n\t\t\t\t\t\t\t!normalAssociations.some(\n\t\t\t\t\t\t\t\t(a2) =>\n\t\t\t\t\t\t\t\t\ta1.nodeId === a2.nodeId\n\t\t\t\t\t\t\t\t\t&& a1.endpoint === a2.endpoint,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\tret.set(groupId, assocs);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret;\n}\n\nexport function getAllAssociations(\n\tctx: GetValueDB,\n\tnode: NodeId & GetAllEndpoints<EndpointId & SupportsCC>,\n): ReadonlyObjectKeyMap<\n\tAssociationAddress,\n\tReadonlyMap<number, readonly AssociationAddress[]>\n> {\n\tconst ret = new ObjectKeyMap<\n\t\tAssociationAddress,\n\t\tReadonlyMap<number, readonly AssociationAddress[]>\n\t>();\n\tfor (const endpoint of node.getAllEndpoints()) {\n\t\tconst address: AssociationAddress = {\n\t\t\tnodeId: node.id,\n\t\t\tendpoint: endpoint.index,\n\t\t};\n\t\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\t\tret.set(address, getAssociations(ctx, endpoint));\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport function checkAssociation(\n\tctx:\n\t\t& HostIDs\n\t\t& GetValueDB\n\t\t& GetNode<\n\t\t\t& NodeId\n\t\t\t& SupportsCC\n\t\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t\t& QuerySecurityClasses\n\t\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestination: AssociationAddress,\n): AssociationCheckResult {\n\t// Check that the target endpoint exists except when adding an association to the controller\n\tconst targetNode = ctx.getNodeOrThrow(destination.nodeId);\n\tconst targetEndpoint = destination.nodeId === ctx.ownNodeId\n\t\t? targetNode\n\t\t: targetNode.getEndpointOrThrow(destination.endpoint ?? 0);\n\n\tif (\n\t\t!endpoint.supportsCC(CommandClasses.Association)\n\t\t&& !endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])\n\t) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Associations to and from ZWLR devices are not allowed\n\tif (isLongRangeNodeId(destination.nodeId)) {\n\t\treturn AssociationCheckResult.Forbidden_DestinationIsLongRange;\n\t} else if (isLongRangeNodeId(endpoint.nodeId)) {\n\t\t// Except the lifeline back to the host\n\t\tif (group !== 1 || destination.nodeId !== ctx.ownNodeId) {\n\t\t\treturn AssociationCheckResult.Forbidden_SourceIsLongRange;\n\t\t}\n\t}\n\n\t// The following checks don't apply to Lifeline associations\n\tif (destination.nodeId === ctx.ownNodeId) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\t// Disallow self-associations\n\tif (destination.nodeId === endpoint.nodeId) {\n\t\treturn AssociationCheckResult.Forbidden_SelfAssociation;\n\t}\n\n\t// For Association version 1 and version 2 / MCA version 1-3:\n\t// A controlling node MUST NOT associate Node A to a Node B destination\n\t// if Node A and Node B\u2019s highest Security Class are not identical.\n\t// For Association version 3 / MCA version 4:\n\t// A controlling node MUST NOT associate Node A to a Node B destination\n\t// if Node A was not granted Node B\u2019s highest Security Class.\n\n\tconst sourceNode = ctx.getNode(endpoint.nodeId)!;\n\tlet securityClassMustMatch: boolean;\n\tif (destination.endpoint == undefined) {\n\t\t// \"normal\" association\n\t\tconst sourceNodeCCVersion = endpoint.getCCVersion(\n\t\t\tCommandClasses.Association,\n\t\t);\n\t\tsecurityClassMustMatch = sourceNodeCCVersion < 3;\n\t} else {\n\t\t// multi channel association\n\t\tconst sourceNodeCCVersion = endpoint.getCCVersion(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t);\n\t\tsecurityClassMustMatch = sourceNodeCCVersion < 4;\n\t}\n\n\tconst sourceSecurityClass = sourceNode.getHighestSecurityClass();\n\tconst targetSecurityClass = targetNode.getHighestSecurityClass();\n\n\t// If the security classes are unknown, all bets are off\n\tif (sourceSecurityClass != undefined && targetSecurityClass != undefined) {\n\t\tif (\n\t\t\tsecurityClassMustMatch\n\t\t\t&& sourceSecurityClass !== targetSecurityClass\n\t\t) {\n\t\t\treturn AssociationCheckResult.Forbidden_SecurityClassMismatch;\n\t\t} else if (\n\t\t\t// Commands to insecure nodes are allowed\n\t\t\ttargetSecurityClass !== SecurityClass.None\n\t\t\t// Otherwise, the sender must know the target's highest key\n\t\t\t&& !securityClassMustMatch\n\t\t\t&& !sourceNode.hasSecurityClass(targetSecurityClass)\n\t\t) {\n\t\t\treturn AssociationCheckResult\n\t\t\t\t.Forbidden_DestinationSecurityClassNotGranted;\n\t\t}\n\t}\n\n\t// SDS14223:\n\t// A controlling node MUST NOT associate Node A to a Node B destination that does not support\n\t// the Command Class that the Node A will be controlling\n\t//\n\t// To determine this, the node must support the AGI CC or we have no way of knowing which\n\t// CCs the node will control\n\tif (!endpoint.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\tconst groupCommandList = AssociationGroupInfoCC.getIssuedCommandsCached(\n\t\tctx,\n\t\tendpoint,\n\t\tgroup,\n\t);\n\tif (!groupCommandList || !groupCommandList.size) {\n\t\t// We don't know which CCs this group controls, just allow it\n\t\treturn AssociationCheckResult.OK;\n\t}\n\tconst groupCCs = [...groupCommandList.keys()];\n\n\t// A controlling node MAY create an association to a destination supporting an\n\t// actuator Command Class if the actual association group sends Basic Control Command Class.\n\tif (\n\t\tgroupCCs.includes(CommandClasses.Basic)\n\t\t&& actuatorCCs.some((cc) => targetEndpoint?.supportsCC(cc))\n\t) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\t// Enforce that at least one issued CC is supported\n\tif (groupCCs.some((cc) => targetEndpoint?.supportsCC(cc))) {\n\t\treturn AssociationCheckResult.OK;\n\t} else {\n\t\treturn AssociationCheckResult.Forbidden_NoSupportedCCs;\n\t}\n}\n\nexport function getAssociationGroups(\n\tctx: GetValueDB & GetDeviceConfig,\n\tendpoint: EndpointId & SupportsCC,\n): ReadonlyMap<number, AssociationGroup> {\n\t// Check whether we have multi channel support or not\n\tlet assocInstance: typeof AssociationCC;\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t} else {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t}\n\n\tconst assocGroupCount = assocInstance.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst mcGroupCount = mcInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst groupCount = Math.max(assocGroupCount, mcGroupCount);\n\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\n\tconst ret = new Map<number, AssociationGroup>();\n\n\tif (endpoint.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t// We can read all information we need from the AGI CC\n\t\tconst agiInstance = AssociationGroupInfoCC;\n\t\tfor (let group = 1; group <= groupCount; group++) {\n\t\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\t\tendpoint.index,\n\t\t\t\tgroup,\n\t\t\t);\n\t\t\tconst multiChannel = !!mcInstance && group <= mcGroupCount;\n\t\t\tret.set(group, {\n\t\t\t\tmaxNodes: (multiChannel\n\t\t\t\t\t? mcInstance!\n\t\t\t\t\t: assocInstance).getMaxNodesCached(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t) || 1,\n\t\t\t\t// AGI implies Z-Wave+ where group 1 is the lifeline\n\t\t\t\tisLifeline: group === 1,\n\t\t\t\tlabel:\n\t\t\t\t\t// prefer the configured label if we have one\n\t\t\t\t\tassocConfig?.label\n\t\t\t\t\t\t// the ones reported by AGI are sometimes pretty bad\n\t\t\t\t\t\t?? agiInstance.getGroupNameCached(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\tgroup,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t// but still better than \"unnamed\"\n\t\t\t\t\t\t?? `Unnamed group ${group}`,\n\t\t\t\tmultiChannel,\n\t\t\t\tprofile: agiInstance.getGroupProfileCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t\tgroup,\n\t\t\t\t),\n\t\t\t\tissuedCommands: agiInstance.getIssuedCommandsCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t\tgroup,\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t} else {\n\t\t// we need to consult the device config\n\t\tfor (let group = 1; group <= groupCount; group++) {\n\t\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\t\tendpoint.index,\n\t\t\t\tgroup,\n\t\t\t);\n\t\t\tconst multiChannel = !!mcInstance && group <= mcGroupCount;\n\t\t\tret.set(group, {\n\t\t\t\tmaxNodes: (multiChannel\n\t\t\t\t\t? mcInstance!\n\t\t\t\t\t: assocInstance).getMaxNodesCached(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t)\n\t\t\t\t\t|| assocConfig?.maxNodes\n\t\t\t\t\t|| 1,\n\t\t\t\tisLifeline: assocConfig?.isLifeline ?? group === 1,\n\t\t\t\tlabel: assocConfig?.label ?? `Unnamed group ${group}`,\n\t\t\t\tmultiChannel,\n\t\t\t});\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport function getAllAssociationGroups(\n\tctx: GetValueDB & GetDeviceConfig,\n\tnode: NodeId & GetAllEndpoints<EndpointId & SupportsCC>,\n): ReadonlyMap<number, ReadonlyMap<number, AssociationGroup>> {\n\tconst ret = new Map<number, ReadonlyMap<number, AssociationGroup>>();\n\tfor (const endpoint of node.getAllEndpoints()) {\n\t\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\t\tret.set(endpoint.index, getAssociationGroups(ctx, endpoint));\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport async function addAssociations(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t& QuerySecurityClasses\n\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestinations: AssociationAddress[],\n): Promise<void> {\n\tconst nodeAndEndpointString = `${endpoint.nodeId}${\n\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t}`;\n\n\t// Check whether we should add any associations the device does not have support for\n\tlet assocInstance: typeof AssociationCC | undefined;\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\t// Split associations into conventional and endpoint associations\n\tconst nodeAssociations = distinct(\n\t\tdestinations\n\t\t\t.filter((a) => a.endpoint == undefined)\n\t\t\t.map((a) => a.nodeId),\n\t);\n\tconst endpointAssociations = destinations.filter(\n\t\t(a) => a.endpoint != undefined,\n\t) as EndpointAddress[];\n\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t} else if (nodeAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t} else if (endpointAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Disallow associating a node with itself. This is technically checked as part of\n\t// checkAssociations, but here we provide a better error message.\n\tconst selfAssociations = destinations.filter((d) =>\n\t\td.nodeId === endpoint.nodeId\n\t);\n\tif (selfAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Associating a node with itself is not allowed!`,\n\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\tselfAssociations.map((a) => ({\n\t\t\t\t...a,\n\t\t\t\tcheckResult: AssociationCheckResult.Forbidden_SelfAssociation,\n\t\t\t})),\n\t\t);\n\t}\n\n\tconst assocGroupCount = assocInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst mcGroupCount = mcInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst groupCount = Math.max(assocGroupCount, mcGroupCount);\n\tif (group > groupCount) {\n\t\tthrow new ZWaveError(\n\t\t\t`Group ${group} does not exist on node ${nodeAndEndpointString}`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\n\tconst groupIsMultiChannel = !!mcInstance\n\t\t&& group <= mcGroupCount\n\t\t&& deviceConfig?.associations?.get(group)?.multiChannel !== false;\n\n\tif (groupIsMultiChannel) {\n\t\t// Check that all associations are allowed\n\t\tconst disallowedAssociations = destinations.map(\n\t\t\t(a) => ({\n\t\t\t\t...a,\n\t\t\t\tcheckResult: checkAssociation(ctx, endpoint, group, a),\n\t\t\t}),\n\t\t).filter(({ checkResult }) =>\n\t\t\tcheckResult !== AssociationCheckResult.OK\n\t\t);\n\t\tif (disallowedAssociations.length) {\n\t\t\tlet message = `The following associations are not allowed:`;\n\t\t\tmessage += disallowedAssociations\n\t\t\t\t.map(\n\t\t\t\t\t(a) =>\n\t\t\t\t\t\t`\\n\u00B7 Node ${a.nodeId}${\n\t\t\t\t\t\t\ta.endpoint ? `, endpoint ${a.endpoint}` : \"\"\n\t\t\t\t\t\t}: ${\n\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\tAssociationCheckResult,\n\t\t\t\t\t\t\t\ta.checkResult,\n\t\t\t\t\t\t\t).replace(\"Forbidden_\", \"\")\n\t\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t\t.join(\"\");\n\t\t\tthrow new ZWaveError(\n\t\t\t\tmessage,\n\t\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\t\tdisallowedAssociations,\n\t\t\t);\n\t\t}\n\n\t\t// And add them\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.addDestinations({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t\tendpoints: endpointAssociations,\n\t\t});\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t} else {\n\t\t// Although the node supports multi channel associations, this group only supports \"normal\" associations\n\t\tif (destinations.some((a) => a.endpoint != undefined)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Node ${nodeAndEndpointString}, group ${group} does not support multi channel associations!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Check that all associations are allowed\n\t\tconst disallowedAssociations = destinations.map(\n\t\t\t(a) => ({\n\t\t\t\t...a,\n\t\t\t\tcheckResult: checkAssociation(ctx, endpoint, group, a),\n\t\t\t}),\n\t\t).filter(({ checkResult }) =>\n\t\t\tcheckResult !== AssociationCheckResult.OK\n\t\t);\n\t\tif (disallowedAssociations.length) {\n\t\t\tlet message =\n\t\t\t\t`The associations to the following nodes are not allowed`;\n\t\t\tmessage += disallowedAssociations\n\t\t\t\t.map(\n\t\t\t\t\t(a) =>\n\t\t\t\t\t\t`\\n\u00B7 Node ${a.nodeId}: ${\n\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\tAssociationCheckResult,\n\t\t\t\t\t\t\t\ta.checkResult,\n\t\t\t\t\t\t\t).replace(\"Forbidden_\", \"\")\n\t\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t\t.join(\"\");\n\n\t\t\tthrow new ZWaveError(\n\t\t\t\tmessage,\n\t\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\t\tdisallowedAssociations,\n\t\t\t);\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.addNodeIds(group, ...destinations.map((a) => a.nodeId));\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t}\n}\n\nexport async function removeAssociations(\n\tctx: CCAPIHost,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestinations: AssociationAddress[],\n): Promise<void> {\n\tconst nodeAndEndpointString = `${endpoint.nodeId}${\n\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t}`;\n\n\t// Split associations into conventional and endpoint associations\n\tconst nodeAssociations = distinct(\n\t\tdestinations\n\t\t\t.filter((a) => a.endpoint == undefined)\n\t\t\t.map((a) => a.nodeId),\n\t);\n\tconst endpointAssociations = destinations.filter(\n\t\t(a) => a.endpoint != undefined,\n\t) as EndpointAddress[];\n\n\t// Removing associations is not either/or - we could have a device with duplicated associations between\n\t// Association CC and Multi Channel Association CC\n\t// Figure out what we need to use to remove the associations\n\n\tlet groupExistsAsMultiChannel = false;\n\tlet groupExistsAsNodeAssociation = false;\n\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tlet assocInstance: typeof AssociationCC | undefined;\n\n\t// To remove a multi channel association, we need to make sure that the group exists\n\t// and the node supports multi channel associations\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t\tif (group <= mcInstance.getGroupCountCached(ctx, endpoint)) {\n\t\t\tgroupExistsAsMultiChannel = true;\n\t\t}\n\t} else if (endpointAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// To remove a normal association, we need to make sure that the group exists either as a normal association\n\t// or as a multi channel association\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t\tif (group <= assocInstance.getGroupCountCached(ctx, endpoint)) {\n\t\t\tgroupExistsAsNodeAssociation = true;\n\t\t}\n\t}\n\n\tif (!mcInstance && !assocInstance) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Ensure the group exists and can be used\n\tif (!groupExistsAsMultiChannel && !groupExistsAsNodeAssociation) {\n\t\tthrow new ZWaveError(\n\t\t\t` Association group ${group} does not exist for node ${nodeAndEndpointString}`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\tif (endpointAssociations.length > 0 && !groupExistsAsMultiChannel) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString}, association group ${group} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\n\t// Even if we only remove node associations, we use both CCs since it has been found that some\n\t// devices do not correctly share the node list between the two commands\n\tif (\n\t\tassocInstance\n\t\t&& nodeAssociations.length > 0\n\t\t&& groupExistsAsNodeAssociation\n\t) {\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.removeNodeIds({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t});\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t}\n\n\tif (mcInstance && groupExistsAsMultiChannel) {\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.removeDestinations({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t\tendpoints: endpointAssociations,\n\t\t});\n\t\t// Refresh the multi channel association list\n\t\tawait api.getGroup(group);\n\t}\n}\n\nexport function getLifelineGroupIds(\n\tctx: GetValueDB & GetDeviceConfig,\n\tendpoint: EndpointId & SupportsCC,\n): number[] {\n\t// For now only support this for the root endpoint - i.e. node\n\tif (endpoint.index > 0) return [];\n\n\t// Some nodes define multiple lifeline groups, so we need to assign us to\n\t// all of them\n\tconst lifelineGroups: number[] = [];\n\n\t// If the target node supports Z-Wave+ info that means the lifeline MUST be group #1\n\tif (endpoint.supportsCC(CommandClasses[\"Z-Wave Plus Info\"])) {\n\t\tlifelineGroups.push(1);\n\t}\n\n\t// We have a device config file that tells us which (additional) association to assign\n\tlet associations: ReadonlyMap<number, AssociationConfig> | undefined;\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\tif (endpoint.index === 0) {\n\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\tassociations = deviceConfig?.associations\n\t\t\t?? deviceConfig?.endpoints?.get(0)?.associations;\n\t} else {\n\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\tassociations = deviceConfig?.endpoints?.get(\n\t\t\tendpoint.index,\n\t\t)?.associations;\n\t}\n\n\tif (associations?.size) {\n\t\tlifelineGroups.push(\n\t\t\t...[...associations.values()]\n\t\t\t\t.filter((a) => a.isLifeline)\n\t\t\t\t.map((a) => a.groupId),\n\t\t);\n\t}\n\n\treturn distinct(lifelineGroups).toSorted((a, b) => a - b);\n}\n\nexport async function configureLifelineAssociations(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>\n\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n): Promise<void> {\n\t// Assign the controller to all lifeline groups\n\tconst ownNodeId = ctx.ownNodeId;\n\tconst node = ctx.getNodeOrThrow(endpoint.nodeId);\n\tconst valueDB = ctx.getValueDB(node.id);\n\tconst deviceConfig = ctx.getDeviceConfig?.(node.id);\n\n\t// We check if a node supports Multi Channel CC before creating Multi Channel Lifeline Associations (#1109)\n\tconst nodeSupportsMultiChannel = node.supportsCC(\n\t\tCommandClasses[\"Multi Channel\"],\n\t);\n\n\tlet assocInstance: typeof AssociationCC | undefined;\n\tconst assocAPI = CCAPI.create(\n\t\tCommandClasses.Association,\n\t\tctx,\n\t\tendpoint,\n\t);\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t}\n\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tlet mcGroupCount = 0;\n\tconst mcAPI = CCAPI.create(\n\t\tCommandClasses[\"Multi Channel Association\"],\n\t\tctx,\n\t\tendpoint,\n\t);\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t\tmcGroupCount = mcInstance.getGroupCountCached(ctx, endpoint) ?? 0;\n\t}\n\n\tconst lifelineGroups = getLifelineGroupIds(ctx, node);\n\tif (lifelineGroups.length === 0) {\n\t\t// We can look for the General Lifeline AGI profile as a last resort\n\t\tif (\n\t\t\tendpoint.supportsCC(CommandClasses[\"Association Group Information\"])\n\t\t) {\n\t\t\tconst agiAPI = CCAPI.create(\n\t\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\n\t\t\t// The lifeline MUST be group 1\n\t\t\tconst lifeline = await agiAPI\n\t\t\t\t.getGroupInfo(1, true)\n\t\t\t\t.catch(() => undefined);\n\t\t\tif (\n\t\t\t\tlifeline?.profile\n\t\t\t\t\t=== AssociationGroupInfoProfile[\"General: Lifeline\"]\n\t\t\t) {\n\t\t\t\tlifelineGroups.push(1);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (lifelineGroups.length === 0) {\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: endpoint.index,\n\t\t\tmessage:\n\t\t\t\t\"No information about Lifeline associations, cannot assign ourselves!\",\n\t\t\tlevel: \"warn\",\n\t\t});\n\t\t// Remember that we have NO lifeline association\n\t\tvalueDB.setValue(\n\t\t\tAssociationCCValues.hasLifeline.endpoint(endpoint.index),\n\t\t\tfalse,\n\t\t);\n\t\treturn;\n\t}\n\n\tctx.logNode(node.id, {\n\t\tendpoint: endpoint.index,\n\t\tmessage: `Checking/assigning lifeline groups: ${\n\t\t\tlifelineGroups.join(\n\t\t\t\t\", \",\n\t\t\t)\n\t\t}\nsupports classic associations: ${!!assocInstance}\nsupports multi channel associations: ${!!mcInstance}`,\n\t});\n\n\tfor (const group of lifelineGroups) {\n\t\tconst groupSupportsMultiChannelAssociation = group <= mcGroupCount;\n\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\tendpoint.index,\n\t\t\tgroup,\n\t\t);\n\n\t\tconst mustUseNodeAssociation = !groupSupportsMultiChannelAssociation\n\t\t\t|| !nodeSupportsMultiChannel\n\t\t\t|| assocConfig?.multiChannel === false;\n\t\tlet mustUseMultiChannelAssociation = false;\n\n\t\tif (groupSupportsMultiChannelAssociation && nodeSupportsMultiChannel) {\n\t\t\tif (assocConfig?.multiChannel === true) {\n\t\t\t\tmustUseMultiChannelAssociation = true;\n\t\t\t} else if (endpoint.index === 0) {\n\t\t\t\t// If the node has multiple endpoints but none of the extra ones support associations,\n\t\t\t\t// the root endpoints needs a Multi Channel Association\n\t\t\t\tconst allEndpoints = node.getAllEndpoints();\n\t\t\t\tif (\n\t\t\t\t\tallEndpoints.length > 1\n\t\t\t\t\t&& allEndpoints\n\t\t\t\t\t\t.filter((e) => e.index !== endpoint.index)\n\t\t\t\t\t\t.every(\n\t\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t\t!e.supportsCC(CommandClasses.Association)\n\t\t\t\t\t\t\t\t&& !e.supportsCC(\n\t\t\t\t\t\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tmustUseMultiChannelAssociation = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: endpoint.index,\n\t\t\tmessage: `Configuring lifeline group #${group}:\ngroup supports multi channel: ${groupSupportsMultiChannelAssociation}\nconfigured strategy: ${assocConfig?.multiChannel ?? \"auto\"}\nmust use node association: ${mustUseNodeAssociation}\nmust use endpoint association: ${mustUseMultiChannelAssociation}`,\n\t\t});\n\n\t\t// Figure out which associations exist and may need to be removed\n\t\tconst isAssignedAsNodeAssociation = (\n\t\t\tendpoint: EndpointId,\n\t\t): boolean => {\n\t\t\tif (groupSupportsMultiChannelAssociation && mcInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tmcInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& !!mcInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some(\n\t\t\t\t\t\t\t(addr) =>\n\t\t\t\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t\t\t\t&& addr.endpoint == undefined,\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (assocInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tassocInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& !!assocInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some((addr) => addr.nodeId === ownNodeId)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tconst isAssignedAsEndpointAssociation = (\n\t\t\tendpoint: EndpointId,\n\t\t): boolean => {\n\t\t\tif (mcInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tmcInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& mcInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some(\n\t\t\t\t\t\t\t(addr) =>\n\t\t\t\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t\t\t\t&& addr.endpoint === 0,\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\t// If the node was used with other controller software, there might be\n\t\t// invalid lifeline associations which cause reporting problems\n\t\tconst invalidEndpointAssociations: EndpointAddress[] = mcInstance\n\t\t\t?.getAllDestinationsCached(ctx, endpoint)\n\t\t\t.get(group)\n\t\t\t?.filter(\n\t\t\t\t(addr): addr is AssociationAddress & EndpointAddress =>\n\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t&& addr.endpoint != undefined\n\t\t\t\t\t&& addr.endpoint !== 0,\n\t\t\t) ?? [];\n\n\t\t// Clean them up first\n\t\tif (\n\t\t\tinvalidEndpointAssociations.length > 0\n\t\t\t&& mcAPI.isSupported()\n\t\t\t&& groupSupportsMultiChannelAssociation\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`Found invalid lifeline associations in group #${group}, removing them...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\tgroupId: group,\n\t\t\t\tendpoints: invalidEndpointAssociations,\n\t\t\t});\n\t\t\t// refresh the associations - don't trust that it worked\n\t\t\tawait mcAPI.getGroup(group);\n\t\t}\n\n\t\t// Assigning the correct lifelines depends on the association kind, source endpoint and the desired strategy:\n\t\t//\n\t\t// When `mustUseMultiChannelAssociation` is `true` - Use a multi channel association (if possible), no fallback\n\t\t// When `mustUseNodeAssociation` is `true` - Use a node association (if possible), no fallback\n\t\t// Otherwise:\n\t\t// 1. Try a node association on the current endpoint/root\n\t\t// 2. If Association CC is not supported, try assigning a node association with the Multi Channel Association CC\n\t\t// 3. If that did not work, fall back to a multi channel association (target endpoint 0)\n\t\t// 4. If that did not work either, the endpoint index is >0 and the node is Z-Wave+:\n\t\t// Fall back to a multi channel association (target endpoint 0) on the root, if it doesn't have one yet.\n\n\t\tlet hasLifeline = false;\n\n\t\t// First try: node association\n\t\tif (!mustUseMultiChannelAssociation) {\n\t\t\tif (isAssignedAsNodeAssociation(endpoint)) {\n\t\t\t\t// We already have the correct association\n\t\t\t\thasLifeline = true;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Lifeline group #${group} is already assigned with a node association`,\n\t\t\t\t\tdirection: \"none\",\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tassocAPI.isSupported()\n\t\t\t\t// Some endpoint groups don't support having any destinations because they are shared with the root\n\t\t\t\t&& assocInstance!.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t> 0\n\t\t\t) {\n\t\t\t\t// We can use a node association, but first remove any possible endpoint associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Association CC...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\tisAssignedAsEndpointAssociation(endpoint)\n\t\t\t\t\t&& mcAPI.isSupported()\n\t\t\t\t) {\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t});\n\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\tawait mcAPI.getGroup(group);\n\t\t\t\t}\n\n\t\t\t\tawait assocAPI.addNodeIds(group, ownNodeId);\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await assocAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.nodeIds.includes(ownNodeId);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a node association via Association CC`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Association CC did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Second try: Node association using the Multi Channel Association CC\n\t\t\tif (\n\t\t\t\t!hasLifeline\n\t\t\t\t&& mcAPI.isSupported()\n\t\t\t\t&& mcInstance!.getMaxNodesCached(ctx, endpoint, group) > 0\n\t\t\t) {\n\t\t\t\t// We can use a node association, but first remove any possible endpoint associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Multi Channel Association CC...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (isAssignedAsEndpointAssociation(endpoint)) {\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait mcAPI.addDestinations({\n\t\t\t\t\tgroupId: group,\n\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t});\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await mcAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.nodeIds.includes(ownNodeId);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a node association via Multi Channel Association CC`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Multi Channel Association CC did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Third try: Use an endpoint association (target endpoint 0)\n\t\t// This is only supported starting in Multi Channel Association CC V3\n\t\tif (!hasLifeline && !mustUseNodeAssociation) {\n\t\t\tif (isAssignedAsEndpointAssociation(endpoint)) {\n\t\t\t\t// We already have the correct association\n\t\t\t\thasLifeline = true;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Lifeline group #${group} is already assigned with an endpoint association`,\n\t\t\t\t\tdirection: \"none\",\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tmcAPI.isSupported()\n\t\t\t\t&& mcAPI.version >= 3\n\t\t\t\t&& mcInstance!.getMaxNodesCached(ctx, endpoint, group) > 0\n\t\t\t) {\n\t\t\t\t// We can use a multi channel association, but first remove any possible node associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (isAssignedAsNodeAssociation(endpoint)) {\n\t\t\t\t\t// It has been found that some devices don't correctly share the node associations between\n\t\t\t\t\t// Association CC and Multi Channel Association CC, so we remove the nodes from both lists\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t});\n\t\t\t\t\tif (assocAPI.isSupported()) {\n\t\t\t\t\t\tawait assocAPI.removeNodeIds({\n\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\tawait assocAPI.getGroup(group);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tawait mcAPI.addDestinations({\n\t\t\t\t\tgroupId: group,\n\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t});\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await mcAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.endpoints.some(\n\t\t\t\t\t(a) => a.nodeId === ownNodeId && a.endpoint === 0,\n\t\t\t\t);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a multi channel association`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Last attempt (actual Z-Wave+ Lifelines only): Try a multi channel association on the root.\n\t\t// Endpoint interviews happen AFTER the root interview, so this enables us to overwrite what\n\t\t// we previously configured on the root.\n\t\tif (\n\t\t\t!hasLifeline\n\t\t\t&& group === 1\n\t\t\t&& node.supportsCC(CommandClasses[\"Z-Wave Plus Info\"])\n\t\t\t&& endpoint.index > 0\n\t\t) {\n\t\t\t// But first check if the root may have a multi channel association\n\t\t\tconst rootAssocConfig = deviceConfig\n\t\t\t\t?.getAssociationConfigForEndpoint(0, group);\n\t\t\tconst rootMustUseNodeAssociation = !nodeSupportsMultiChannel\n\t\t\t\t|| rootAssocConfig?.multiChannel === false;\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`Checking root device for fallback assignment of lifeline group #${group}:\nroot supports multi channel: ${nodeSupportsMultiChannel}\nconfigured strategy: ${rootAssocConfig?.multiChannel ?? \"auto\"}\nmust use node association: ${rootMustUseNodeAssociation}`,\n\t\t\t});\n\n\t\t\tif (!rootMustUseNodeAssociation) {\n\t\t\t\tif (isAssignedAsEndpointAssociation(node)) {\n\t\t\t\t\t// We already have the correct association\n\t\t\t\t\thasLifeline = true;\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} is already assigned with a multi channel association on the root device`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst rootMCAPI = CCAPI.create(\n\t\t\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t);\n\t\t\t\t\tconst rootAssocAPI = CCAPI.create(\n\t\t\t\t\t\tCommandClasses.Association,\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t);\n\t\t\t\t\tif (rootMCAPI.isSupported()) {\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association on the root device...`,\n\t\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// Clean up node associations because they might prevent us from adding the endpoint association\n\t\t\t\t\t\tif (isAssignedAsNodeAssociation(node)) {\n\t\t\t\t\t\t\t// It has been found that some devices don't correctly share the node associations between\n\t\t\t\t\t\t\t// Association CC and Multi Channel Association CC, so we remove the nodes from both lists\n\t\t\t\t\t\t\tawait rootMCAPI.removeDestinations({\n\t\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (rootAssocAPI.isSupported()) {\n\t\t\t\t\t\t\t\tawait rootAssocAPI.removeNodeIds({\n\t\t\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\t\t\tawait rootAssocAPI.getGroup(group);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait rootMCAPI.addDestinations({\n\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\tconst groupReport = await rootMCAPI.getGroup(group);\n\t\t\t\t\t\thasLifeline = !!groupReport?.endpoints.some(\n\t\t\t\t\t\t\t(a) => a.nodeId === ownNodeId && a.endpoint === 0,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!hasLifeline) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`All attempts to assign lifeline group #${group} failed, skipping...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\t}\n\n\t// Remember that we did the association assignment\n\tvalueDB.setValue(\n\t\tAssociationCCValues.hasLifeline.endpoint(endpoint.index),\n\t\ttrue,\n\t);\n}\n\nexport async function assignLifelineIssueingCommand(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t& QuerySecurityClasses\n\t>,\n\tendpoint: EndpointId,\n\tccId: CommandClasses,\n\tccCommand: number,\n): Promise<void> {\n\tconst node = ctx.getNodeOrThrow(endpoint.nodeId);\n\tif (\n\t\tnode.supportsCC(CommandClasses[\"Association Group Information\"])\n\t\t&& (node.supportsCC(CommandClasses.Association)\n\t\t\t|| node.supportsCC(CommandClasses[\"Multi Channel Association\"]))\n\t) {\n\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\tctx,\n\t\t\t\tnode,\n\t\t\t\tccId,\n\t\t\t\tccCommand,\n\t\t\t);\n\t\tif (groupsIssueingNotifications.length > 0) {\n\t\t\t// We always grab the first group - usually it should be the lifeline\n\t\t\tconst groupId = groupsIssueingNotifications[0];\n\t\t\tconst existingAssociations = getAssociations(ctx, node).get(groupId)\n\t\t\t\t?? [];\n\n\t\t\tif (\n\t\t\t\t!existingAssociations.some(\n\t\t\t\t\t(a) => a.nodeId === ctx.ownNodeId,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t)\n\t\t\t\t\t} commands...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tawait addAssociations(ctx, node, groupId, [\n\t\t\t\t\t{ nodeId: ctx.ownNodeId },\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function doesAnyLifelineSendActuatorOrSensorReports(\n\tctx: GetValueDB & GetDeviceConfig,\n\tnode: NodeId & SupportsCC,\n): MaybeNotKnown<boolean> {\n\t// No association support means no unsolicited reports\n\tif (\n\t\t!node.supportsCC(CommandClasses.Association)\n\t\t&& !node.supportsCC(CommandClasses[\"Multi Channel Association\"])\n\t) {\n\t\treturn false;\n\t}\n\n\t// No AGI support means we cannot know\n\tif (!node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\treturn NOT_KNOWN;\n\t}\n\n\t// Lifeline group IDs include the ones we added via a config file, so they may not be considered true lifelines\n\tconst lifelineGroupIds = getLifelineGroupIds(ctx, node);\n\t// If any potential lifeline group has the \"General: Lifeline\" profile, the node MUST send unsolicited reports that way\n\tif (\n\t\tlifelineGroupIds.some(\n\t\t\t(id) =>\n\t\t\t\tAssociationGroupInfoCC.getGroupProfileCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tnode,\n\t\t\t\t\tid,\n\t\t\t\t) === AssociationGroupInfoProfile[\"General: Lifeline\"],\n\t\t)\n\t) {\n\t\treturn true;\n\t}\n\n\t// Otherwise check if any of the groups sends any actuator or sensor commands. We'll assume that those are reports\n\tfor (const groupId of lifelineGroupIds) {\n\t\tconst issuedCommands = AssociationGroupInfoCC.getIssuedCommandsCached(\n\t\t\tctx,\n\t\t\tnode,\n\t\t\tgroupId,\n\t\t);\n\t\tif (!issuedCommands) continue;\n\t\tconst commands = [...issuedCommands.keys()];\n\t\tif (commands.some((c) => isActuatorCC(c) || isSensorCC(c))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;;AAAA,kBAsBO;AACP,oBAIO;AACP,oBAAyB;AACzB,2BAAmD;AACnD,oCAAuC;AACvC,uCAA0C;AAC1C,iBAAsD;AACtD,mBAMO;AAED,SAAU,gBACf,KACA,UAAiC;AAEjC,QAAM,MAAM,oBAAI,IAAG;AAEnB,MAAI,SAAS,WAAW,2BAAe,WAAW,GAAG;AACpD,UAAM,eAAe,mCAAc,yBAClC,KACA,QAAQ;AAET,eAAW,CAAC,SAAS,MAAM,KAAK,cAAc;AAC7C,UAAI,IAAI,SAAS,MAAM;IACxB;EACD,OAAO;AACN,UAAM,IAAI,uBACT,QAAQ,SAAS,MAAM,GACtB,SAAS,QAAQ,IAAI,cAAc,SAAS,KAAK,KAAK,EACvD,mCACA,4BAAgB,eAAe;EAEjC;AAGA,MAAI,SAAS,WAAW,2BAAe,2BAA2B,CAAC,GAAG;AACrE,UAAM,eAAe,2DAA0B,yBAC9C,KACA,QAAQ;AAET,eAAW,CAAC,SAAS,MAAM,KAAK,cAAc;AAC7C,UAAI,IAAI,IAAI,OAAO,GAAG;AACrB,cAAM,qBAAqB,I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AAW,CAAC,CAAC,GAAG;AAC3D,aAAO;IACR;EACD;AAEA,SAAO;AACR;AAhDgB;",
|
|
4
|
+
"sourcesContent": ["import type { AssociationConfig, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype EndpointId,\n\ttype GetAllEndpoints,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype MaybeNotKnown,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype QuerySecurityClasses,\n\tSecurityClass,\n\ttype SupportsCC,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tactuatorCCs,\n\tgetCCName,\n\tisActuatorCC,\n\tisLongRangeNodeId,\n\tisSensorCC,\n} from \"@zwave-js/core\";\nimport {\n\tObjectKeyMap,\n\ttype ReadonlyObjectKeyMap,\n\tgetEnumMemberName,\n} from \"@zwave-js/shared\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { AssociationCC, AssociationCCValues } from \"../cc/AssociationCC.js\";\nimport { AssociationGroupInfoCC } from \"../cc/AssociationGroupInfoCC.js\";\nimport { MultiChannelAssociationCC } from \"../cc/MultiChannelAssociationCC.js\";\nimport { CCAPI, type CCAPIHost, type CCAPINode } from \"./API.js\";\nimport {\n\ttype AssociationAddress,\n\tAssociationCheckResult,\n\ttype AssociationGroup,\n\tAssociationGroupInfoProfile,\n\ttype EndpointAddress,\n} from \"./_Types.js\";\n\nexport function getAssociations(\n\tctx: GetValueDB,\n\tendpoint: EndpointId & SupportsCC,\n): ReadonlyMap<number, readonly AssociationAddress[]> {\n\tconst ret = new Map<number, readonly AssociationAddress[]>();\n\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tconst destinations = AssociationCC.getAllDestinationsCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (const [groupId, assocs] of destinations) {\n\t\t\tret.set(groupId, assocs);\n\t\t}\n\t} else {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Merge the \"normal\" destinations with multi channel destinations\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tconst destinations = MultiChannelAssociationCC.getAllDestinationsCached(\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tfor (const [groupId, assocs] of destinations) {\n\t\t\tif (ret.has(groupId)) {\n\t\t\t\tconst normalAssociations = ret.get(groupId)!;\n\t\t\t\tret.set(groupId, [\n\t\t\t\t\t...normalAssociations,\n\t\t\t\t\t// Eliminate potential duplicates\n\t\t\t\t\t...assocs.filter(\n\t\t\t\t\t\t(a1) =>\n\t\t\t\t\t\t\t!normalAssociations.some(\n\t\t\t\t\t\t\t\t(a2) =>\n\t\t\t\t\t\t\t\t\ta1.nodeId === a2.nodeId\n\t\t\t\t\t\t\t\t\t&& a1.endpoint === a2.endpoint,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\tret.set(groupId, assocs);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret;\n}\n\nexport function getAllAssociations(\n\tctx: GetValueDB,\n\tnode: NodeId & GetAllEndpoints<EndpointId & SupportsCC>,\n): ReadonlyObjectKeyMap<\n\tAssociationAddress,\n\tReadonlyMap<number, readonly AssociationAddress[]>\n> {\n\tconst ret = new ObjectKeyMap<\n\t\tAssociationAddress,\n\t\tReadonlyMap<number, readonly AssociationAddress[]>\n\t>();\n\tfor (const endpoint of node.getAllEndpoints()) {\n\t\tconst address: AssociationAddress = {\n\t\t\tnodeId: node.id,\n\t\t\tendpoint: endpoint.index,\n\t\t};\n\t\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\t\tret.set(address, getAssociations(ctx, endpoint));\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport function checkAssociation(\n\tctx:\n\t\t& HostIDs\n\t\t& GetValueDB\n\t\t& GetNode<\n\t\t\t& NodeId\n\t\t\t& SupportsCC\n\t\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t\t& QuerySecurityClasses\n\t\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestination: AssociationAddress,\n): AssociationCheckResult {\n\t// Check that the target endpoint exists except when adding an association to the controller\n\tconst targetNode = ctx.getNodeOrThrow(destination.nodeId);\n\tconst targetEndpoint = destination.nodeId === ctx.ownNodeId\n\t\t? targetNode\n\t\t: targetNode.getEndpointOrThrow(destination.endpoint ?? 0);\n\n\tif (\n\t\t!endpoint.supportsCC(CommandClasses.Association)\n\t\t&& !endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])\n\t) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Associations to and from ZWLR devices are not allowed\n\tif (isLongRangeNodeId(destination.nodeId)) {\n\t\treturn AssociationCheckResult.Forbidden_DestinationIsLongRange;\n\t} else if (isLongRangeNodeId(endpoint.nodeId)) {\n\t\t// Except the lifeline back to the host\n\t\tif (group !== 1 || destination.nodeId !== ctx.ownNodeId) {\n\t\t\treturn AssociationCheckResult.Forbidden_SourceIsLongRange;\n\t\t}\n\t}\n\n\t// The following checks don't apply to Lifeline associations\n\tif (destination.nodeId === ctx.ownNodeId) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\t// Disallow self-associations\n\tif (destination.nodeId === endpoint.nodeId) {\n\t\treturn AssociationCheckResult.Forbidden_SelfAssociation;\n\t}\n\n\t// For Association version 1 and version 2 / MCA version 1-3:\n\t// A controlling node MUST NOT associate Node A to a Node B destination\n\t// if Node A and Node B\u2019s highest Security Class are not identical.\n\t// For Association version 3 / MCA version 4:\n\t// A controlling node MUST NOT associate Node A to a Node B destination\n\t// if Node A was not granted Node B\u2019s highest Security Class.\n\n\tconst sourceNode = ctx.getNode(endpoint.nodeId)!;\n\tlet securityClassMustMatch: boolean;\n\tif (destination.endpoint == undefined) {\n\t\t// \"normal\" association\n\t\tconst sourceNodeCCVersion = endpoint.getCCVersion(\n\t\t\tCommandClasses.Association,\n\t\t);\n\t\tsecurityClassMustMatch = sourceNodeCCVersion < 3;\n\t} else {\n\t\t// multi channel association\n\t\tconst sourceNodeCCVersion = endpoint.getCCVersion(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t);\n\t\tsecurityClassMustMatch = sourceNodeCCVersion < 4;\n\t}\n\n\tconst sourceSecurityClass = sourceNode.getHighestSecurityClass();\n\tconst targetSecurityClass = targetNode.getHighestSecurityClass();\n\n\t// If the security classes are unknown, all bets are off\n\tif (sourceSecurityClass != undefined && targetSecurityClass != undefined) {\n\t\tif (\n\t\t\tsecurityClassMustMatch\n\t\t\t&& sourceSecurityClass !== targetSecurityClass\n\t\t) {\n\t\t\treturn AssociationCheckResult.Forbidden_SecurityClassMismatch;\n\t\t} else if (\n\t\t\t// Commands to insecure nodes are allowed\n\t\t\ttargetSecurityClass !== SecurityClass.None\n\t\t\t// Otherwise, the sender must know the target's highest key\n\t\t\t&& !securityClassMustMatch\n\t\t\t&& !sourceNode.hasSecurityClass(targetSecurityClass)\n\t\t) {\n\t\t\treturn AssociationCheckResult\n\t\t\t\t.Forbidden_DestinationSecurityClassNotGranted;\n\t\t}\n\t}\n\n\t// SDS14223:\n\t// A controlling node MUST NOT associate Node A to a Node B destination that does not support\n\t// the Command Class that the Node A will be controlling\n\t//\n\t// To determine this, the node must support the AGI CC or we have no way of knowing which\n\t// CCs the node will control\n\tif (!endpoint.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\tconst groupCommandList = AssociationGroupInfoCC.getIssuedCommandsCached(\n\t\tctx,\n\t\tendpoint,\n\t\tgroup,\n\t);\n\tif (!groupCommandList || !groupCommandList.size) {\n\t\t// We don't know which CCs this group controls, just allow it\n\t\treturn AssociationCheckResult.OK;\n\t}\n\tconst groupCCs = [...groupCommandList.keys()];\n\n\t// A controlling node MAY create an association to a destination supporting an\n\t// actuator Command Class if the actual association group sends Basic Control Command Class.\n\tif (\n\t\tgroupCCs.includes(CommandClasses.Basic)\n\t\t&& actuatorCCs.some((cc) => targetEndpoint?.supportsCC(cc))\n\t) {\n\t\treturn AssociationCheckResult.OK;\n\t}\n\n\t// Enforce that at least one issued CC is supported\n\tif (groupCCs.some((cc) => targetEndpoint?.supportsCC(cc))) {\n\t\treturn AssociationCheckResult.OK;\n\t} else {\n\t\treturn AssociationCheckResult.Forbidden_NoSupportedCCs;\n\t}\n}\n\nexport function getAssociationGroups(\n\tctx: GetValueDB & GetDeviceConfig,\n\tendpoint: EndpointId & SupportsCC,\n): ReadonlyMap<number, AssociationGroup> {\n\t// Check whether we have multi channel support or not\n\tlet assocInstance: typeof AssociationCC;\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t} else {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${endpoint.nodeId}${\n\t\t\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t\t\t} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t}\n\n\tconst assocGroupCount = assocInstance.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst mcGroupCount = mcInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst groupCount = Math.max(assocGroupCount, mcGroupCount);\n\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\n\tconst ret = new Map<number, AssociationGroup>();\n\n\tif (endpoint.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t// We can read all information we need from the AGI CC\n\t\tconst agiInstance = AssociationGroupInfoCC;\n\t\tfor (let group = 1; group <= groupCount; group++) {\n\t\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\t\tendpoint.index,\n\t\t\t\tgroup,\n\t\t\t);\n\t\t\tconst multiChannel = !!mcInstance && group <= mcGroupCount;\n\t\t\tret.set(group, {\n\t\t\t\tmaxNodes: (multiChannel\n\t\t\t\t\t? mcInstance!\n\t\t\t\t\t: assocInstance).getMaxNodesCached(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t) || 1,\n\t\t\t\t// AGI implies Z-Wave+ where group 1 is the lifeline\n\t\t\t\tisLifeline: group === 1,\n\t\t\t\tlabel:\n\t\t\t\t\t// prefer the configured label if we have one\n\t\t\t\t\tassocConfig?.label\n\t\t\t\t\t\t// the ones reported by AGI are sometimes pretty bad\n\t\t\t\t\t\t?? agiInstance.getGroupNameCached(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\tgroup,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t// but still better than \"unnamed\"\n\t\t\t\t\t\t?? `Unnamed group ${group}`,\n\t\t\t\tmultiChannel,\n\t\t\t\tprofile: agiInstance.getGroupProfileCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t\tgroup,\n\t\t\t\t),\n\t\t\t\tissuedCommands: agiInstance.getIssuedCommandsCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tendpoint,\n\t\t\t\t\tgroup,\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t} else {\n\t\t// we need to consult the device config\n\t\tfor (let group = 1; group <= groupCount; group++) {\n\t\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\t\tendpoint.index,\n\t\t\t\tgroup,\n\t\t\t);\n\t\t\tconst multiChannel = !!mcInstance && group <= mcGroupCount;\n\t\t\tret.set(group, {\n\t\t\t\tmaxNodes: (multiChannel\n\t\t\t\t\t? mcInstance!\n\t\t\t\t\t: assocInstance).getMaxNodesCached(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t)\n\t\t\t\t\t|| assocConfig?.maxNodes\n\t\t\t\t\t|| 1,\n\t\t\t\tisLifeline: assocConfig?.isLifeline ?? group === 1,\n\t\t\t\tlabel: assocConfig?.label ?? `Unnamed group ${group}`,\n\t\t\t\tmultiChannel,\n\t\t\t});\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport function getAllAssociationGroups(\n\tctx: GetValueDB & GetDeviceConfig,\n\tnode: NodeId & GetAllEndpoints<EndpointId & SupportsCC>,\n): ReadonlyMap<number, ReadonlyMap<number, AssociationGroup>> {\n\tconst ret = new Map<number, ReadonlyMap<number, AssociationGroup>>();\n\tfor (const endpoint of node.getAllEndpoints()) {\n\t\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\t\tret.set(endpoint.index, getAssociationGroups(ctx, endpoint));\n\t\t}\n\t}\n\treturn ret;\n}\n\nexport async function addAssociations(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t& QuerySecurityClasses\n\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestinations: AssociationAddress[],\n\toptions?: {\n\t\t/**\n\t\t * Whether to force creating associations even if they are not allowed.\n\t\t * **Note:** Invalid associations will most likely not work\n\t\t */\n\t\tforce?: boolean;\n\t},\n): Promise<void> {\n\tconst nodeAndEndpointString = `${endpoint.nodeId}${\n\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t}`;\n\n\t// Check whether we should add any associations the device does not have support for\n\tlet assocInstance: typeof AssociationCC | undefined;\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\t// Split associations into conventional and endpoint associations\n\tconst nodeAssociations = distinct(\n\t\tdestinations\n\t\t\t.filter((a) => a.endpoint == undefined)\n\t\t\t.map((a) => a.nodeId),\n\t);\n\tconst endpointAssociations = destinations.filter(\n\t\t(a) => a.endpoint != undefined,\n\t) as EndpointAddress[];\n\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t} else if (nodeAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t} else if (endpointAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Disallow associating a node with itself. This is technically checked as part of\n\t// checkAssociations, but here we provide a better error message.\n\tconst selfAssociations = destinations.filter((d) =>\n\t\td.nodeId === endpoint.nodeId\n\t);\n\tif (selfAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Associating a node with itself is not allowed!`,\n\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\tselfAssociations.map((a) => ({\n\t\t\t\t...a,\n\t\t\t\tcheckResult: AssociationCheckResult.Forbidden_SelfAssociation,\n\t\t\t})),\n\t\t);\n\t}\n\n\tconst assocGroupCount = assocInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst mcGroupCount = mcInstance?.getGroupCountCached(ctx, endpoint)\n\t\t?? 0;\n\tconst groupCount = Math.max(assocGroupCount, mcGroupCount);\n\tif (group > groupCount) {\n\t\tthrow new ZWaveError(\n\t\t\t`Group ${group} does not exist on node ${nodeAndEndpointString}`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\n\tconst groupIsMultiChannel = !!mcInstance\n\t\t&& group <= mcGroupCount\n\t\t&& deviceConfig?.associations?.get(group)?.multiChannel !== false;\n\n\tif (groupIsMultiChannel) {\n\t\t// Check that all associations are allowed\n\t\tif (!options?.force) {\n\t\t\tconst disallowedAssociations = destinations.map(\n\t\t\t\t(a) => ({\n\t\t\t\t\t...a,\n\t\t\t\t\tcheckResult: checkAssociation(ctx, endpoint, group, a),\n\t\t\t\t}),\n\t\t\t).filter(({ checkResult }) =>\n\t\t\t\tcheckResult !== AssociationCheckResult.OK\n\t\t\t);\n\t\t\tif (disallowedAssociations.length) {\n\t\t\t\tlet message = `The following associations are not allowed:`;\n\t\t\t\tmessage += disallowedAssociations\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(a) =>\n\t\t\t\t\t\t\t`\\n\u00B7 Node ${a.nodeId}${\n\t\t\t\t\t\t\t\ta.endpoint ? `, endpoint ${a.endpoint}` : \"\"\n\t\t\t\t\t\t\t}: ${\n\t\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\t\tAssociationCheckResult,\n\t\t\t\t\t\t\t\t\ta.checkResult,\n\t\t\t\t\t\t\t\t).replace(\"Forbidden_\", \"\")\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\");\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\tmessage,\n\t\t\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\t\t\tdisallowedAssociations,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// And add them\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.addDestinations({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t\tendpoints: endpointAssociations,\n\t\t});\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t} else {\n\t\t// Although the node supports multi channel associations, this group only supports \"normal\" associations\n\t\tif (destinations.some((a) => a.endpoint != undefined)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Node ${nodeAndEndpointString}, group ${group} does not support multi channel associations!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Check that all associations are allowed\n\t\tif (!options?.force) {\n\t\t\tconst disallowedAssociations = destinations.map(\n\t\t\t\t(a) => ({\n\t\t\t\t\t...a,\n\t\t\t\t\tcheckResult: checkAssociation(ctx, endpoint, group, a),\n\t\t\t\t}),\n\t\t\t).filter(({ checkResult }) =>\n\t\t\t\tcheckResult !== AssociationCheckResult.OK\n\t\t\t);\n\t\t\tif (disallowedAssociations.length) {\n\t\t\t\tlet message =\n\t\t\t\t\t`The associations to the following nodes are not allowed`;\n\t\t\t\tmessage += disallowedAssociations\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(a) =>\n\t\t\t\t\t\t\t`\\n\u00B7 Node ${a.nodeId}: ${\n\t\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\t\tAssociationCheckResult,\n\t\t\t\t\t\t\t\t\ta.checkResult,\n\t\t\t\t\t\t\t\t).replace(\"Forbidden_\", \"\")\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\");\n\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\tmessage,\n\t\t\t\t\tZWaveErrorCodes.AssociationCC_NotAllowed,\n\t\t\t\t\tdisallowedAssociations,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.addNodeIds(group, ...destinations.map((a) => a.nodeId));\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t}\n}\n\nexport async function removeAssociations(\n\tctx: CCAPIHost,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n\tgroup: number,\n\tdestinations: AssociationAddress[],\n): Promise<void> {\n\tconst nodeAndEndpointString = `${endpoint.nodeId}${\n\t\tendpoint.index > 0 ? `, endpoint ${endpoint.index}` : \"\"\n\t}`;\n\n\t// Split associations into conventional and endpoint associations\n\tconst nodeAssociations = distinct(\n\t\tdestinations\n\t\t\t.filter((a) => a.endpoint == undefined)\n\t\t\t.map((a) => a.nodeId),\n\t);\n\tconst endpointAssociations = destinations.filter(\n\t\t(a) => a.endpoint != undefined,\n\t) as EndpointAddress[];\n\n\t// Removing associations is not either/or - we could have a device with duplicated associations between\n\t// Association CC and Multi Channel Association CC\n\t// Figure out what we need to use to remove the associations\n\n\tlet groupExistsAsMultiChannel = false;\n\tlet groupExistsAsNodeAssociation = false;\n\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tlet assocInstance: typeof AssociationCC | undefined;\n\n\t// To remove a multi channel association, we need to make sure that the group exists\n\t// and the node supports multi channel associations\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t\tif (group <= mcInstance.getGroupCountCached(ctx, endpoint)) {\n\t\t\tgroupExistsAsMultiChannel = true;\n\t\t}\n\t} else if (endpointAssociations.length > 0) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// To remove a normal association, we need to make sure that the group exists either as a normal association\n\t// or as a multi channel association\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t\tif (group <= assocInstance.getGroupCountCached(ctx, endpoint)) {\n\t\t\tgroupExistsAsNodeAssociation = true;\n\t\t}\n\t}\n\n\tif (!mcInstance && !assocInstance) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString} does not support associations!`,\n\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t);\n\t}\n\n\t// Ensure the group exists and can be used\n\tif (!groupExistsAsMultiChannel && !groupExistsAsNodeAssociation) {\n\t\tthrow new ZWaveError(\n\t\t\t` Association group ${group} does not exist for node ${nodeAndEndpointString}`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\tif (endpointAssociations.length > 0 && !groupExistsAsMultiChannel) {\n\t\tthrow new ZWaveError(\n\t\t\t`Node ${nodeAndEndpointString}, association group ${group} does not support multi channel associations!`,\n\t\t\tZWaveErrorCodes.AssociationCC_InvalidGroup,\n\t\t);\n\t}\n\n\t// Even if we only remove node associations, we use both CCs since it has been found that some\n\t// devices do not correctly share the node list between the two commands\n\tif (\n\t\tassocInstance\n\t\t&& nodeAssociations.length > 0\n\t\t&& groupExistsAsNodeAssociation\n\t) {\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Association,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.removeNodeIds({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t});\n\t\t// Refresh the association list\n\t\tawait api.getGroup(group);\n\t}\n\n\tif (mcInstance && groupExistsAsMultiChannel) {\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t);\n\t\tawait api.removeDestinations({\n\t\t\tgroupId: group,\n\t\t\tnodeIds: nodeAssociations,\n\t\t\tendpoints: endpointAssociations,\n\t\t});\n\t\t// Refresh the multi channel association list\n\t\tawait api.getGroup(group);\n\t}\n}\n\nexport function getLifelineGroupIds(\n\tctx: GetValueDB & GetDeviceConfig,\n\tendpoint: EndpointId & SupportsCC,\n): number[] {\n\t// For now only support this for the root endpoint - i.e. node\n\tif (endpoint.index > 0) return [];\n\n\t// Some nodes define multiple lifeline groups, so we need to assign us to\n\t// all of them\n\tconst lifelineGroups: number[] = [];\n\n\t// If the target node supports Z-Wave+ info that means the lifeline MUST be group #1\n\tif (endpoint.supportsCC(CommandClasses[\"Z-Wave Plus Info\"])) {\n\t\tlifelineGroups.push(1);\n\t}\n\n\t// We have a device config file that tells us which (additional) association to assign\n\tlet associations: ReadonlyMap<number, AssociationConfig> | undefined;\n\tconst deviceConfig = ctx.getDeviceConfig?.(endpoint.nodeId);\n\tif (endpoint.index === 0) {\n\t\t// The root endpoint's associations may be configured separately or as part of \"endpoints\"\n\t\tassociations = deviceConfig?.associations\n\t\t\t?? deviceConfig?.endpoints?.get(0)?.associations;\n\t} else {\n\t\t// The other endpoints can only have a configuration as part of \"endpoints\"\n\t\tassociations = deviceConfig?.endpoints?.get(\n\t\t\tendpoint.index,\n\t\t)?.associations;\n\t}\n\n\tif (associations?.size) {\n\t\tlifelineGroups.push(\n\t\t\t...[...associations.values()]\n\t\t\t\t.filter((a) => a.isLifeline)\n\t\t\t\t.map((a) => a.groupId),\n\t\t);\n\t}\n\n\treturn distinct(lifelineGroups).toSorted((a, b) => a - b);\n}\n\nexport async function configureLifelineAssociations(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>\n\t>,\n\tendpoint: EndpointId & SupportsCC & ControlsCC,\n): Promise<void> {\n\t// Assign the controller to all lifeline groups\n\tconst ownNodeId = ctx.ownNodeId;\n\tconst node = ctx.getNodeOrThrow(endpoint.nodeId);\n\tconst valueDB = ctx.getValueDB(node.id);\n\tconst deviceConfig = ctx.getDeviceConfig?.(node.id);\n\n\t// We check if a node supports Multi Channel CC before creating Multi Channel Lifeline Associations (#1109)\n\tconst nodeSupportsMultiChannel = node.supportsCC(\n\t\tCommandClasses[\"Multi Channel\"],\n\t);\n\n\tlet assocInstance: typeof AssociationCC | undefined;\n\tconst assocAPI = CCAPI.create(\n\t\tCommandClasses.Association,\n\t\tctx,\n\t\tendpoint,\n\t);\n\tif (endpoint.supportsCC(CommandClasses.Association)) {\n\t\tassocInstance = AssociationCC;\n\t}\n\n\tlet mcInstance: typeof MultiChannelAssociationCC | undefined;\n\tlet mcGroupCount = 0;\n\tconst mcAPI = CCAPI.create(\n\t\tCommandClasses[\"Multi Channel Association\"],\n\t\tctx,\n\t\tendpoint,\n\t);\n\tif (endpoint.supportsCC(CommandClasses[\"Multi Channel Association\"])) {\n\t\tmcInstance = MultiChannelAssociationCC;\n\t\tmcGroupCount = mcInstance.getGroupCountCached(ctx, endpoint) ?? 0;\n\t}\n\n\tconst lifelineGroups = getLifelineGroupIds(ctx, node);\n\tif (lifelineGroups.length === 0) {\n\t\t// We can look for the General Lifeline AGI profile as a last resort\n\t\tif (\n\t\t\tendpoint.supportsCC(CommandClasses[\"Association Group Information\"])\n\t\t) {\n\t\t\tconst agiAPI = CCAPI.create(\n\t\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t);\n\n\t\t\t// The lifeline MUST be group 1\n\t\t\tconst lifeline = await agiAPI\n\t\t\t\t.getGroupInfo(1, true)\n\t\t\t\t.catch(() => undefined);\n\t\t\tif (\n\t\t\t\tlifeline?.profile\n\t\t\t\t\t=== AssociationGroupInfoProfile[\"General: Lifeline\"]\n\t\t\t) {\n\t\t\t\tlifelineGroups.push(1);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (lifelineGroups.length === 0) {\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: endpoint.index,\n\t\t\tmessage:\n\t\t\t\t\"No information about Lifeline associations, cannot assign ourselves!\",\n\t\t\tlevel: \"warn\",\n\t\t});\n\t\t// Remember that we have NO lifeline association\n\t\tvalueDB.setValue(\n\t\t\tAssociationCCValues.hasLifeline.endpoint(endpoint.index),\n\t\t\tfalse,\n\t\t);\n\t\treturn;\n\t}\n\n\tctx.logNode(node.id, {\n\t\tendpoint: endpoint.index,\n\t\tmessage: `Checking/assigning lifeline groups: ${\n\t\t\tlifelineGroups.join(\n\t\t\t\t\", \",\n\t\t\t)\n\t\t}\nsupports classic associations: ${!!assocInstance}\nsupports multi channel associations: ${!!mcInstance}`,\n\t});\n\n\tfor (const group of lifelineGroups) {\n\t\tconst groupSupportsMultiChannelAssociation = group <= mcGroupCount;\n\t\tconst assocConfig = deviceConfig?.getAssociationConfigForEndpoint(\n\t\t\tendpoint.index,\n\t\t\tgroup,\n\t\t);\n\n\t\tconst mustUseNodeAssociation = !groupSupportsMultiChannelAssociation\n\t\t\t|| !nodeSupportsMultiChannel\n\t\t\t|| assocConfig?.multiChannel === false;\n\t\tlet mustUseMultiChannelAssociation = false;\n\n\t\tif (groupSupportsMultiChannelAssociation && nodeSupportsMultiChannel) {\n\t\t\tif (assocConfig?.multiChannel === true) {\n\t\t\t\tmustUseMultiChannelAssociation = true;\n\t\t\t} else if (endpoint.index === 0) {\n\t\t\t\t// If the node has multiple endpoints but none of the extra ones support associations,\n\t\t\t\t// the root endpoints needs a Multi Channel Association\n\t\t\t\tconst allEndpoints = node.getAllEndpoints();\n\t\t\t\tif (\n\t\t\t\t\tallEndpoints.length > 1\n\t\t\t\t\t&& allEndpoints\n\t\t\t\t\t\t.filter((e) => e.index !== endpoint.index)\n\t\t\t\t\t\t.every(\n\t\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t\t!e.supportsCC(CommandClasses.Association)\n\t\t\t\t\t\t\t\t&& !e.supportsCC(\n\t\t\t\t\t\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tmustUseMultiChannelAssociation = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: endpoint.index,\n\t\t\tmessage: `Configuring lifeline group #${group}:\ngroup supports multi channel: ${groupSupportsMultiChannelAssociation}\nconfigured strategy: ${assocConfig?.multiChannel ?? \"auto\"}\nmust use node association: ${mustUseNodeAssociation}\nmust use endpoint association: ${mustUseMultiChannelAssociation}`,\n\t\t});\n\n\t\t// Figure out which associations exist and may need to be removed\n\t\tconst isAssignedAsNodeAssociation = (\n\t\t\tendpoint: EndpointId,\n\t\t): boolean => {\n\t\t\tif (groupSupportsMultiChannelAssociation && mcInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tmcInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& !!mcInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some(\n\t\t\t\t\t\t\t(addr) =>\n\t\t\t\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t\t\t\t&& addr.endpoint == undefined,\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (assocInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tassocInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& !!assocInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some((addr) => addr.nodeId === ownNodeId)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tconst isAssignedAsEndpointAssociation = (\n\t\t\tendpoint: EndpointId,\n\t\t): boolean => {\n\t\t\tif (mcInstance) {\n\t\t\t\tif (\n\t\t\t\t\t// Only consider a group if it doesn't share its associations with the root endpoint\n\t\t\t\t\tmcInstance.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t\t> 0\n\t\t\t\t\t&& mcInstance\n\t\t\t\t\t\t.getAllDestinationsCached(ctx, endpoint)\n\t\t\t\t\t\t.get(group)\n\t\t\t\t\t\t?.some(\n\t\t\t\t\t\t\t(addr) =>\n\t\t\t\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t\t\t\t&& addr.endpoint === 0,\n\t\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\t// If the node was used with other controller software, there might be\n\t\t// invalid lifeline associations which cause reporting problems\n\t\tconst invalidEndpointAssociations: EndpointAddress[] = mcInstance\n\t\t\t?.getAllDestinationsCached(ctx, endpoint)\n\t\t\t.get(group)\n\t\t\t?.filter(\n\t\t\t\t(addr): addr is AssociationAddress & EndpointAddress =>\n\t\t\t\t\taddr.nodeId === ownNodeId\n\t\t\t\t\t&& addr.endpoint != undefined\n\t\t\t\t\t&& addr.endpoint !== 0,\n\t\t\t) ?? [];\n\n\t\t// Clean them up first\n\t\tif (\n\t\t\tinvalidEndpointAssociations.length > 0\n\t\t\t&& mcAPI.isSupported()\n\t\t\t&& groupSupportsMultiChannelAssociation\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`Found invalid lifeline associations in group #${group}, removing them...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\tgroupId: group,\n\t\t\t\tendpoints: invalidEndpointAssociations,\n\t\t\t});\n\t\t\t// refresh the associations - don't trust that it worked\n\t\t\tawait mcAPI.getGroup(group);\n\t\t}\n\n\t\t// Assigning the correct lifelines depends on the association kind, source endpoint and the desired strategy:\n\t\t//\n\t\t// When `mustUseMultiChannelAssociation` is `true` - Use a multi channel association (if possible), no fallback\n\t\t// When `mustUseNodeAssociation` is `true` - Use a node association (if possible), no fallback\n\t\t// Otherwise:\n\t\t// 1. Try a node association on the current endpoint/root\n\t\t// 2. If Association CC is not supported, try assigning a node association with the Multi Channel Association CC\n\t\t// 3. If that did not work, fall back to a multi channel association (target endpoint 0)\n\t\t// 4. If that did not work either, the endpoint index is >0 and the node is Z-Wave+:\n\t\t// Fall back to a multi channel association (target endpoint 0) on the root, if it doesn't have one yet.\n\n\t\tlet hasLifeline = false;\n\n\t\t// First try: node association\n\t\tif (!mustUseMultiChannelAssociation) {\n\t\t\tif (isAssignedAsNodeAssociation(endpoint)) {\n\t\t\t\t// We already have the correct association\n\t\t\t\thasLifeline = true;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Lifeline group #${group} is already assigned with a node association`,\n\t\t\t\t\tdirection: \"none\",\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tassocAPI.isSupported()\n\t\t\t\t// Some endpoint groups don't support having any destinations because they are shared with the root\n\t\t\t\t&& assocInstance!.getMaxNodesCached(ctx, endpoint, group)\n\t\t\t\t\t> 0\n\t\t\t) {\n\t\t\t\t// We can use a node association, but first remove any possible endpoint associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Association CC...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\tisAssignedAsEndpointAssociation(endpoint)\n\t\t\t\t\t&& mcAPI.isSupported()\n\t\t\t\t) {\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t});\n\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\tawait mcAPI.getGroup(group);\n\t\t\t\t}\n\n\t\t\t\tawait assocAPI.addNodeIds(group, ownNodeId);\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await assocAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.nodeIds.includes(ownNodeId);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a node association via Association CC`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Association CC did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Second try: Node association using the Multi Channel Association CC\n\t\t\tif (\n\t\t\t\t!hasLifeline\n\t\t\t\t&& mcAPI.isSupported()\n\t\t\t\t&& mcInstance!.getMaxNodesCached(ctx, endpoint, group) > 0\n\t\t\t) {\n\t\t\t\t// We can use a node association, but first remove any possible endpoint associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Multi Channel Association CC...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (isAssignedAsEndpointAssociation(endpoint)) {\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait mcAPI.addDestinations({\n\t\t\t\t\tgroupId: group,\n\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t});\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await mcAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.nodeIds.includes(ownNodeId);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a node association via Multi Channel Association CC`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a node association via Multi Channel Association CC did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Third try: Use an endpoint association (target endpoint 0)\n\t\t// This is only supported starting in Multi Channel Association CC V3\n\t\tif (!hasLifeline && !mustUseNodeAssociation) {\n\t\t\tif (isAssignedAsEndpointAssociation(endpoint)) {\n\t\t\t\t// We already have the correct association\n\t\t\t\thasLifeline = true;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Lifeline group #${group} is already assigned with an endpoint association`,\n\t\t\t\t\tdirection: \"none\",\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tmcAPI.isSupported()\n\t\t\t\t&& mcAPI.version >= 3\n\t\t\t\t&& mcInstance!.getMaxNodesCached(ctx, endpoint, group) > 0\n\t\t\t) {\n\t\t\t\t// We can use a multi channel association, but first remove any possible node associations\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tif (isAssignedAsNodeAssociation(endpoint)) {\n\t\t\t\t\t// It has been found that some devices don't correctly share the node associations between\n\t\t\t\t\t// Association CC and Multi Channel Association CC, so we remove the nodes from both lists\n\t\t\t\t\tawait mcAPI.removeDestinations({\n\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t});\n\t\t\t\t\tif (assocAPI.isSupported()) {\n\t\t\t\t\t\tawait assocAPI.removeNodeIds({\n\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\tawait assocAPI.getGroup(group);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tawait mcAPI.addDestinations({\n\t\t\t\t\tgroupId: group,\n\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t});\n\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\tconst groupReport = await mcAPI.getGroup(group);\n\t\t\t\thasLifeline = !!groupReport?.endpoints.some(\n\t\t\t\t\t(a) => a.nodeId === ownNodeId && a.endpoint === 0,\n\t\t\t\t);\n\n\t\t\t\tif (hasLifeline) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} was assigned with a multi channel association`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association did not work`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Last attempt (actual Z-Wave+ Lifelines only): Try a multi channel association on the root.\n\t\t// Endpoint interviews happen AFTER the root interview, so this enables us to overwrite what\n\t\t// we previously configured on the root.\n\t\tif (\n\t\t\t!hasLifeline\n\t\t\t&& group === 1\n\t\t\t&& node.supportsCC(CommandClasses[\"Z-Wave Plus Info\"])\n\t\t\t&& endpoint.index > 0\n\t\t) {\n\t\t\t// But first check if the root may have a multi channel association\n\t\t\tconst rootAssocConfig = deviceConfig\n\t\t\t\t?.getAssociationConfigForEndpoint(0, group);\n\t\t\tconst rootMustUseNodeAssociation = !nodeSupportsMultiChannel\n\t\t\t\t|| rootAssocConfig?.multiChannel === false;\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`Checking root device for fallback assignment of lifeline group #${group}:\nroot supports multi channel: ${nodeSupportsMultiChannel}\nconfigured strategy: ${rootAssocConfig?.multiChannel ?? \"auto\"}\nmust use node association: ${rootMustUseNodeAssociation}`,\n\t\t\t});\n\n\t\t\tif (!rootMustUseNodeAssociation) {\n\t\t\t\tif (isAssignedAsEndpointAssociation(node)) {\n\t\t\t\t\t// We already have the correct association\n\t\t\t\t\thasLifeline = true;\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Lifeline group #${group} is already assigned with a multi channel association on the root device`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst rootMCAPI = CCAPI.create(\n\t\t\t\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t);\n\t\t\t\t\tconst rootAssocAPI = CCAPI.create(\n\t\t\t\t\t\tCommandClasses.Association,\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t);\n\t\t\t\t\tif (rootMCAPI.isSupported()) {\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Assigning lifeline group #${group} with a multi channel association on the root device...`,\n\t\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// Clean up node associations because they might prevent us from adding the endpoint association\n\t\t\t\t\t\tif (isAssignedAsNodeAssociation(node)) {\n\t\t\t\t\t\t\t// It has been found that some devices don't correctly share the node associations between\n\t\t\t\t\t\t\t// Association CC and Multi Channel Association CC, so we remove the nodes from both lists\n\t\t\t\t\t\t\tawait rootMCAPI.removeDestinations({\n\t\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (rootAssocAPI.isSupported()) {\n\t\t\t\t\t\t\t\tawait rootAssocAPI.removeNodeIds({\n\t\t\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\t\t\tnodeIds: [ownNodeId],\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\t\t\tawait rootAssocAPI.getGroup(group);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait rootMCAPI.addDestinations({\n\t\t\t\t\t\t\tgroupId: group,\n\t\t\t\t\t\t\tendpoints: [{ nodeId: ownNodeId, endpoint: 0 }],\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// refresh the associations - don't trust that it worked\n\t\t\t\t\t\tconst groupReport = await rootMCAPI.getGroup(group);\n\t\t\t\t\t\thasLifeline = !!groupReport?.endpoints.some(\n\t\t\t\t\t\t\t(a) => a.nodeId === ownNodeId && a.endpoint === 0,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!hasLifeline) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage:\n\t\t\t\t\t`All attempts to assign lifeline group #${group} failed, skipping...`,\n\t\t\t\tdirection: \"none\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\t}\n\n\t// Remember that we did the association assignment\n\tvalueDB.setValue(\n\t\tAssociationCCValues.hasLifeline.endpoint(endpoint.index),\n\t\ttrue,\n\t);\n}\n\nexport async function assignLifelineIssueingCommand(\n\tctx: CCAPIHost<\n\t\t& CCAPINode\n\t\t& SupportsCC\n\t\t& ControlsCC\n\t\t& GetEndpoint<EndpointId & SupportsCC>\n\t\t& QuerySecurityClasses\n\t>,\n\tendpoint: EndpointId,\n\tccId: CommandClasses,\n\tccCommand: number,\n): Promise<void> {\n\tconst node = ctx.getNodeOrThrow(endpoint.nodeId);\n\tif (\n\t\tnode.supportsCC(CommandClasses[\"Association Group Information\"])\n\t\t&& (node.supportsCC(CommandClasses.Association)\n\t\t\t|| node.supportsCC(CommandClasses[\"Multi Channel Association\"]))\n\t) {\n\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\tctx,\n\t\t\t\tnode,\n\t\t\t\tccId,\n\t\t\t\tccCommand,\n\t\t\t);\n\t\tif (groupsIssueingNotifications.length > 0) {\n\t\t\t// We always grab the first group - usually it should be the lifeline\n\t\t\tconst groupId = groupsIssueingNotifications[0];\n\t\t\tconst existingAssociations = getAssociations(ctx, node).get(groupId)\n\t\t\t\t?? [];\n\n\t\t\tif (\n\t\t\t\t!existingAssociations.some(\n\t\t\t\t\t(a) => a.nodeId === ctx.ownNodeId,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: endpoint.index,\n\t\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\t\tgetCCName(\n\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t)\n\t\t\t\t\t} commands...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tawait addAssociations(ctx, node, groupId, [\n\t\t\t\t\t{ nodeId: ctx.ownNodeId },\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function doesAnyLifelineSendActuatorOrSensorReports(\n\tctx: GetValueDB & GetDeviceConfig,\n\tnode: NodeId & SupportsCC,\n): MaybeNotKnown<boolean> {\n\t// No association support means no unsolicited reports\n\tif (\n\t\t!node.supportsCC(CommandClasses.Association)\n\t\t&& !node.supportsCC(CommandClasses[\"Multi Channel Association\"])\n\t) {\n\t\treturn false;\n\t}\n\n\t// No AGI support means we cannot know\n\tif (!node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\treturn NOT_KNOWN;\n\t}\n\n\t// Lifeline group IDs include the ones we added via a config file, so they may not be considered true lifelines\n\tconst lifelineGroupIds = getLifelineGroupIds(ctx, node);\n\t// If any potential lifeline group has the \"General: Lifeline\" profile, the node MUST send unsolicited reports that way\n\tif (\n\t\tlifelineGroupIds.some(\n\t\t\t(id) =>\n\t\t\t\tAssociationGroupInfoCC.getGroupProfileCached(\n\t\t\t\t\tctx,\n\t\t\t\t\tnode,\n\t\t\t\t\tid,\n\t\t\t\t) === AssociationGroupInfoProfile[\"General: Lifeline\"],\n\t\t)\n\t) {\n\t\treturn true;\n\t}\n\n\t// Otherwise check if any of the groups sends any actuator or sensor commands. We'll assume that those are reports\n\tfor (const groupId of lifelineGroupIds) {\n\t\tconst issuedCommands = AssociationGroupInfoCC.getIssuedCommandsCached(\n\t\t\tctx,\n\t\t\tnode,\n\t\t\tgroupId,\n\t\t);\n\t\tif (!issuedCommands) continue;\n\t\tconst commands = [...issuedCommands.keys()];\n\t\tif (commands.some((c) => isActuatorCC(c) || isSensorCC(c))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;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SAAS;UACnB,SAAS,2CACR,uBACC,IAAI,CAEN;UACA,WAAW;SACX;AACD,cAAM,gBAAgB,KAAK,MAAM,SAAS;UACzC,EAAE,QAAQ,IAAI,UAAS;SACvB;MACF;IACD;EACD;AACD;AAnDsB;AAqDhB,SAAU,2CACf,KACA,MAAyB;AAGzB,MACC,CAAC,KAAK,WAAW,2BAAe,WAAW,KACxC,CAAC,KAAK,WAAW,2BAAe,2BAA2B,CAAC,GAC9D;AACD,WAAO;EACR;AAGA,MAAI,CAAC,KAAK,WAAW,2BAAe,+BAA+B,CAAC,GAAG;AACtE,WAAO;EACR;AAGA,QAAM,mBAAmB,oBAAoB,KAAK,IAAI;AAEtD,MACC,iBAAiB,KAChB,CAAC,OACA,qDAAuB,sBACtB,KACA,MACA,EAAE,MACG,yCAA4B,mBAAmB,CAAC,GAEvD;AACD,WAAO;EACR;AAGA,aAAW,WAAW,kBAAkB;AACvC,UAAM,iBAAiB,qDAAuB,wBAC7C,KACA,MACA,OAAO;AAER,QAAI,CAAC;AAAgB;AACrB,UAAM,WAAW,CAAC,GAAG,eAAe,KAAI,CAAE;AAC1C,QAAI,SAAS,KAAK,CAAC,UAAM,0BAAa,CAAC,SAAK,wBAAW,CAAC,CAAC,GAAG;AAC3D,aAAO;IACR;EACD;AAEA,SAAO;AACR;AAhDgB;",
|
|
6
6
|
"names": ["endpoint"]
|
|
7
7
|
}
|
|
@@ -359,7 +359,7 @@ let AssociationGroupInfoCCNameReport = (() => {
|
|
|
359
359
|
}
|
|
360
360
|
serialize(ctx) {
|
|
361
361
|
this.payload = Bytes.concat([
|
|
362
|
-
|
|
362
|
+
[this.groupId, this.name.length],
|
|
363
363
|
Bytes.from(this.name, "utf8"),
|
|
364
364
|
]);
|
|
365
365
|
return super.serialize(ctx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssociationGroupInfoCC.js","sourceRoot":"","sources":["../../../src/cc/AssociationGroupInfoCC.ts"],"names":[],"mappings":";;;;;;;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I,CAAC,OAAO;oBACxB,aAAa,EAAE,IAAI,CAAC,UAAU;iBAC9B;aACD,CAAC;QACH,CAAC;;;;SA7CW,oCAAoC"}
|
|
@@ -338,7 +338,7 @@ let BatteryCCReport = (() => {
|
|
|
338
338
|
if (this.chargingStatus != undefined) {
|
|
339
339
|
this.payload = Bytes.concat([
|
|
340
340
|
this.payload,
|
|
341
|
-
|
|
341
|
+
[
|
|
342
342
|
(this.chargingStatus << 6)
|
|
343
343
|
+ (this.rechargeable ? 0b0010_0000 : 0)
|
|
344
344
|
+ (this.backup ? 0b0001_0000 : 0)
|
|
@@ -352,7 +352,7 @@ let BatteryCCReport = (() => {
|
|
|
352
352
|
: 0),
|
|
353
353
|
(this.lowTemperatureStatus ? 0b10 : 0)
|
|
354
354
|
+ (this.disconnected ? 0b1 : 0),
|
|
355
|
-
]
|
|
355
|
+
],
|
|
356
356
|
]);
|
|
357
357
|
}
|
|
358
358
|
return super.serialize(ctx);
|