Socket
Socket
Sign inDemoInstall

@zwave-js/cc

Package Overview
Dependencies
82
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 11.13.0 to 11.13.1

2

build/cc/AlarmSensorCC.d.ts

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { AlarmSensorCommand, AlarmSensorType } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const AlarmSensorCCValues: Readonly<{

@@ -176,4 +176,4 @@ "use strict";

});
const supportedSensorTypes = this.getValue(applHost, exports.AlarmSensorCCValues.supportedSensorTypes) ??
[];
const supportedSensorTypes = this.getValue(applHost, exports.AlarmSensorCCValues.supportedSensorTypes)
?? [];
// Always query (all of) the sensor's current value(s)

@@ -290,4 +290,4 @@ for (const type of supportedSensorTypes) {

// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)
return (sent.sensorType === _Types_1.AlarmSensorType.Any ||
received.sensorType === sent.sensorType);
return (sent.sensorType === _Types_1.AlarmSensorType.Any
|| received.sensorType === sent.sensorType);
}

@@ -294,0 +294,0 @@ let AlarmSensorCCGet = exports.AlarmSensorCCGet = class AlarmSensorCCGet extends AlarmSensorCC {

@@ -6,4 +6,4 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { AssociationCommand, type AssociationAddress } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type AssociationAddress, AssociationCommand } from "../lib/_Types";
export declare const AssociationCCValues: Readonly<{

@@ -10,0 +10,0 @@ nodeIds: ((groupId: number) => {

@@ -125,6 +125,7 @@ "use strict";

case _Types_1.AssociationCommand.SupportedGroupingsReport:
return true; // This is mandatory
return true;
// Not implemented:
// case AssociationCommand.SpecificGroupGet:
// return this.version >= 2;
// This is mandatory
}

@@ -261,10 +262,10 @@ return super.supportsCommand(cmd);

.getValueDB(endpoint.nodeId)
.getValue(exports.AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index)) ??
.getValue(exports.AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index))
// If the information is not available, fall back to the configuration file if possible
// This can happen on some legacy devices which have "hidden" association groups
applHost
?? applHost
.getDeviceConfig?.(endpoint.nodeId)
?.getAssociationConfigForEndpoint(endpoint.index, groupId)
?.maxNodes ??
0);
?.maxNodes
?? 0);
}

@@ -428,3 +429,4 @@ /**

if (this.version === 1) {
throw new safe_1.ZWaveError(`Node ${this.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
throw new safe_1.ZWaveError(`Node ${this
.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
}

@@ -431,0 +433,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { AssociationGroupInfoCommand, AssociationGroupInfoProfile } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const AssociationGroupInfoCCValues: Readonly<{

@@ -124,4 +124,4 @@ "use strict";

...Values_1.V.dynamicPropertyAndKeyWithName("groupInfo", "info", (groupId) => groupId, ({ property, propertyKey }) => property === "info" && typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyAndKeyWithName("commands", "issuedCommands", (groupId) => groupId, ({ property, propertyKey }) => property === "issuedCommands" &&
typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyAndKeyWithName("commands", "issuedCommands", (groupId) => groupId, ({ property, propertyKey }) => property === "issuedCommands"
&& typeof propertyKey === "number", undefined, { internal: true }),
}),

@@ -262,4 +262,4 @@ });

continue;
if (issuedCommands.has(ccId) &&
issuedCommands.get(ccId).includes(command)) {
if (issuedCommands.has(ccId)
&& issuedCommands.get(ccId).includes(command)) {
ret.push(groupId);

@@ -276,9 +276,9 @@ continue;

// First query the Multi Channel Association CC
(endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"]) &&
MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(applHost, endpoint)) ||
(endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])
&& MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(applHost, endpoint))
// Then the Association CC
(endpoint.supportsCC(safe_1.CommandClasses.Association) &&
AssociationCC_1.AssociationCC.getGroupCountCached(applHost, endpoint)) ||
|| (endpoint.supportsCC(safe_1.CommandClasses.Association)
&& AssociationCC_1.AssociationCC.getGroupCountCached(applHost, endpoint))
// And fall back to 0
0);
|| 0);
}

@@ -294,3 +294,4 @@ async interview(applHost) {

});
const associationGroupCount = AssociationGroupInfoCC_1.getAssociationGroupCountCached(applHost, endpoint);
const associationGroupCount = AssociationGroupInfoCC_1
.getAssociationGroupCountCached(applHost, endpoint);
for (let groupId = 1; groupId <= associationGroupCount; groupId++) {

@@ -331,3 +332,4 @@ // First get the group's name

// Query the information for each group (this is the only thing that could be dynamic)
const associationGroupCount = AssociationGroupInfoCC_1.getAssociationGroupCountCached(applHost, endpoint);
const associationGroupCount = AssociationGroupInfoCC_1
.getAssociationGroupCountCached(applHost, endpoint);
const hasDynamicInfo = this.getValue(applHost, exports.AssociationGroupInfoCCValues.hasDynamicInfo);

@@ -446,3 +448,3 @@ for (let groupId = 1; groupId <= associationGroupCount; groupId++) {

const groupId = groupBytes[0];
const mode = 0; //groupBytes[1];
const mode = 0; // groupBytes[1];
const profile = groupBytes.readUInt16BE(2);

@@ -475,6 +477,5 @@ const eventCode = 0; // groupBytes.readUInt16BE(5);

this.payload = Buffer.alloc(1 + this.groups.length * 7, 0);
this.payload[0] =
(this.isListMode ? 128 : 0) |
(this.hasDynamicInfo ? 64 : 0) |
(this.groups.length & 63);
this.payload[0] = (this.isListMode ? 128 : 0)
| (this.hasDynamicInfo ? 64 : 0)
| (this.groups.length & 63);
for (let i = 0; i < this.groups.length; i++) {

@@ -533,4 +534,4 @@ const offset = 1 + i * 7;

const isListMode = this.listMode === true;
const optionByte = (this.refreshCache ? 128 : 0) |
(isListMode ? 64 : 0);
const optionByte = (this.refreshCache ? 128 : 0)
| (isListMode ? 64 : 0);
this.payload = Buffer.from([

@@ -537,0 +538,0 @@ optionByte,

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, type PollValueImplementation, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { BarrierOperatorCommand, BarrierState, SubsystemState, SubsystemType } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const BarrierOperatorCCValues: Readonly<{

@@ -80,4 +80,4 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Barrier Operator"], {
...Values_1.V.dynamicPropertyAndKeyWithName("signalingState", "signalingState", (subsystemType) => subsystemType, ({ property, propertyKey }) => property === "signalingState" &&
typeof propertyKey === "number", (subsystemType) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("signalingState", "signalingState", (subsystemType) => subsystemType, ({ property, propertyKey }) => property === "signalingState"
&& typeof propertyKey === "number", (subsystemType) => ({
...safe_1.ValueMetadata.UInt8,

@@ -99,3 +99,4 @@ label: `Signaling State (${(0, safe_2.getEnumMemberName)(_Types_1.SubsystemType, subsystemType)})`,

if (exports.BarrierOperatorCCValues.targetState.is(valueId)) {
const currentStateValueId = exports.BarrierOperatorCCValues.currentState.endpoint(this.endpoint.index);
const currentStateValueId = exports.BarrierOperatorCCValues.currentState
.endpoint(this.endpoint.index);
const targetValue = value === _Types_1.BarrierState.Closed

@@ -130,3 +131,4 @@ ? _Types_1.BarrierState.Closed

// Figure out which nodes were affected by this command
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
const affectedNodes = this.endpoint.node.physicalNodes
.filter((node) => node
.getEndpoint(this.endpoint.index)

@@ -155,3 +157,4 @@ ?.supportsCC(this.ccId));

const subsystemType = propertyKey;
const signalingStateValueId = exports.BarrierOperatorCCValues.signalingState(subsystemType).endpoint(this.endpoint.index);
const signalingStateValueId = exports.BarrierOperatorCCValues
.signalingState(subsystemType).endpoint(this.endpoint.index);
return {

@@ -396,4 +399,4 @@ verifyChanges: () => {

}
if (payloadValue === _Types_1.BarrierState.Closed ||
payloadValue >= _Types_1.BarrierState.Closing) {
if (payloadValue === _Types_1.BarrierState.Closed
|| payloadValue >= _Types_1.BarrierState.Closing) {
// predefined states

@@ -400,0 +403,0 @@ this.currentState = payloadValue;

@@ -5,4 +5,4 @@ /// <reference types="node" />

import { type AllOrNone } from "@zwave-js/shared/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, type PollValueImplementation, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { BasicCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const BasicCCValues: Readonly<{

@@ -78,5 +78,5 @@ "use strict";

// Only update currentValue for valid target values
if (typeof value === "number" &&
value >= 0 &&
value <= 99) {
if (typeof value === "number"
&& value >= 0
&& value <= 99) {
if (this.isSinglecast()) {

@@ -87,3 +87,4 @@ this.tryGetValueDB()?.setValue(currentValueValueId, value);

// Figure out which nodes were affected by this command
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
const affectedNodes = this.endpoint.node
.physicalNodes.filter((node) => node
.getEndpoint(this.endpoint.index)

@@ -105,6 +106,6 @@ ?.supportsCC(this.ccId));

verifyChanges: () => {
if (this.isSinglecast() ||
if (this.isSinglecast()
// We generally don't want to poll for multicasts because of how much traffic it can cause
// However, when setting the value 255 (ON), we don't know the actual state
(this.isMulticast() && value === 255)) {
|| (this.isMulticast() && value === 255)) {
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll

@@ -196,4 +197,4 @@ this.schedulePoll(currentValueValueId, value === 255 ? undefined : value);

if (!applHost.getDeviceConfig?.(node.id)?.compat
?.treatBasicSetAsEvent &&
this.getValue(applHost, exports.BasicCCValues.currentValue) == undefined) {
?.treatBasicSetAsEvent
&& this.getValue(applHost, exports.BasicCCValues.currentValue) == undefined) {
applHost.controllerLog.logNode(node.id, {

@@ -302,5 +303,5 @@ endpoint: this.endpointIndex,

];
if (this.version >= 2 &&
this.targetValue !== undefined &&
this.duration) {
if (this.version >= 2
&& this.targetValue !== undefined
&& this.duration) {
payload.push(this.targetValue ?? 0xfe, this.duration.serializeReport());

@@ -307,0 +308,0 @@ }

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { BatteryChargingStatus, BatteryCommand, BatteryReplacementStatus } from "../lib/_Types";

@@ -10,0 +10,0 @@ export declare const BatteryCCValues: Readonly<{

@@ -240,6 +240,6 @@ "use strict";

const lastUpdated = valueDB.getTimestamp(exports.BatteryCCValues.level.endpoint(this.endpointIndex));
return (lastUpdated == undefined ||
return (lastUpdated == undefined
// The specs say once per month, but that's a bit too unfrequent IMO
// Also the maximum that setInterval supports is ~24.85 days
Date.now() - lastUpdated > core_1.timespan.days(7));
|| Date.now() - lastUpdated > core_1.timespan.days(7));
}

@@ -305,9 +305,10 @@ };

// supported
notificationCCVersion > 0 &&
notificationCCVersion > 0
// but idling is not required
notificationCCVersion < 8) {
const batteryLevelStatusValue = NotificationCC_1.NotificationCCValues.notificationVariable("Power Management", "Battery level status");
&& notificationCCVersion < 8) {
const batteryLevelStatusValue = NotificationCC_1.NotificationCCValues
.notificationVariable("Power Management", "Battery level status");
// If not undefined and not idle
if (this.getValue(applHost, batteryLevelStatusValue)) {
this.setValue(applHost, batteryLevelStatusValue, 0 /* idle */);
this.setValue(applHost, batteryLevelStatusValue, 0);
}

@@ -324,15 +325,15 @@ }

Buffer.from([
(this.chargingStatus << 6) +
(this.rechargeable ? 32 : 0) +
(this.backup ? 16 : 0) +
(this.overheating ? 0b1000 : 0) +
(this.lowFluid ? 0b0100 : 0) +
(this.rechargeOrReplace === _Types_1.BatteryReplacementStatus.Now
(this.chargingStatus << 6)
+ (this.rechargeable ? 32 : 0)
+ (this.backup ? 16 : 0)
+ (this.overheating ? 0b1000 : 0)
+ (this.lowFluid ? 0b0100 : 0)
+ (this.rechargeOrReplace === _Types_1.BatteryReplacementStatus.Now
? 0b10
: this.rechargeOrReplace ===
_Types_1.BatteryReplacementStatus.Soon
: this.rechargeOrReplace
=== _Types_1.BatteryReplacementStatus.Soon
? 0b1
: 0),
(this.lowTemperatureStatus ? 0b10 : 0) +
(this.disconnected ? 0b1 : 0),
(this.lowTemperatureStatus ? 0b10 : 0)
+ (this.disconnected ? 0b1 : 0),
]),

@@ -339,0 +340,0 @@ ]);

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { BinarySensorCommand, BinarySensorType } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const BinarySensorCCValues: Readonly<{

@@ -257,5 +257,5 @@ "use strict";

// We expect a Binary Sensor Report that matches the requested sensor type (if a type was requested)
return (sent.sensorType == undefined ||
sent.sensorType === _Types_1.BinarySensorType.Any ||
received.type === sent.sensorType);
return (sent.sensorType == undefined
|| sent.sensorType === _Types_1.BinarySensorType.Any
|| received.type === sent.sensorType);
}

@@ -262,0 +262,0 @@ let BinarySensorCCGet = exports.BinarySensorCCGet = class BinarySensorCCGet extends BinarySensorCC {

@@ -5,4 +5,4 @@ /// <reference types="node" />

import type { AllOrNone } from "@zwave-js/shared";
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, type PollValueImplementation, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { BinarySwitchCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const BinarySwitchCCValues: Readonly<{

@@ -77,3 +77,4 @@ "use strict";

if (property === "targetValue") {
const currentValueValueId = exports.BinarySwitchCCValues.currentValue.endpoint(this.endpoint.index);
const currentValueValueId = exports.BinarySwitchCCValues.currentValue
.endpoint(this.endpoint.index);
return {

@@ -87,3 +88,4 @@ optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {

// Figure out which nodes were affected by this command
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
const affectedNodes = this.endpoint.node.physicalNodes
.filter((node) => node
.getEndpoint(this.endpoint.index)

@@ -90,0 +92,0 @@ ?.supportsCC(this.ccId));

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CentralSceneCommand, CentralSceneKeys } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const CentralSceneCCValues: Readonly<{

@@ -72,5 +72,5 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Central Scene"], {
...Values_1.V.dynamicPropertyAndKeyWithName("scene", "scene", (sceneNumber) => (0, strings_1.padStart)(sceneNumber.toString(), 3, "0"), ({ property, propertyKey }) => property === "scene" &&
typeof propertyKey === "string" &&
/^\d{3}$/.test(propertyKey), (sceneNumber) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("scene", "scene", (sceneNumber) => (0, strings_1.padStart)(sceneNumber.toString(), 3, "0"), ({ property, propertyKey }) => property === "scene"
&& typeof propertyKey === "string"
&& /^\d{3}$/.test(propertyKey), (sceneNumber) => ({
...safe_1.ValueMetadata.ReadOnlyUInt8,

@@ -239,4 +239,4 @@ label: `Scene ${(0, strings_1.padStart)(sceneNumber.toString(), 3, "0")}`,

this.sceneNumber = this.payload[2];
if (this.keyAttribute === _Types_1.CentralSceneKeys.KeyHeldDown &&
this.version >= 3) {
if (this.keyAttribute === _Types_1.CentralSceneKeys.KeyHeldDown
&& this.version >= 3) {
// A receiving node MUST ignore this field if the command is not

@@ -243,0 +243,0 @@ // carrying the Key Held Down key attribute.

@@ -5,4 +5,4 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ClimateControlScheduleCommand, ScheduleOverrideType, Weekday, type SetbackState, type Switchpoint } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ClimateControlScheduleCommand, ScheduleOverrideType, type SetbackState, type Switchpoint, Weekday } from "../lib/_Types";
export declare const ClimateControlScheduleCCValues: Readonly<{

@@ -9,0 +9,0 @@ schedule: ((weekday: Weekday) => {

@@ -138,6 +138,6 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Climate Control Schedule"], {
...Values_1.V.dynamicPropertyAndKeyWithName("schedule", "schedule", (weekday) => weekday, ({ property, propertyKey }) => property === "switchPoints" &&
typeof propertyKey === "number" &&
propertyKey >= _Types_1.Weekday.Monday &&
propertyKey <= _Types_1.Weekday.Sunday, (weekday) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("schedule", "schedule", (weekday) => weekday, ({ property, propertyKey }) => property === "switchPoints"
&& typeof propertyKey === "number"
&& propertyKey >= _Types_1.Weekday.Monday
&& propertyKey <= _Types_1.Weekday.Sunday, (weekday) => ({
...safe_1.ValueMetadata.Any,

@@ -357,4 +357,4 @@ label: `Schedule (${(0, safe_2.getEnumMemberName)(_Types_1.Weekday, weekday)})`,

this.overrideType = this.payload[0] & 0b11;
this.overrideState =
(0, serializers_1.decodeSetbackState)(this.payload[1]) || this.payload[1];
this.overrideState = (0, serializers_1.decodeSetbackState)(this.payload[1])
|| this.payload[1];
}

@@ -361,0 +361,0 @@ toLogEntry(applHost) {

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ClockCommand, Weekday } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare class ClockCCAPI extends CCAPI {

@@ -5,5 +5,5 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ColorComponent, ColorSwitchCommand, LevelChangeDirection, type ColorTable } from "../lib/_Types";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ColorComponent, ColorSwitchCommand, type ColorTable, LevelChangeDirection } from "../lib/_Types";
export declare const ColorSwitchCCValues: Readonly<{

@@ -10,0 +10,0 @@ targetColorChannel: ((component: ColorComponent) => {

@@ -511,5 +511,5 @@ "use strict";

const component = colorTableKeyToComponent(key);
if (component === _Types_1.ColorComponent.Red ||
component === _Types_1.ColorComponent.Green ||
component === _Types_1.ColorComponent.Blue) {
if (component === _Types_1.ColorComponent.Red
|| component === _Types_1.ColorComponent.Green
|| component === _Types_1.ColorComponent.Blue) {
updatedRGB = true;

@@ -576,4 +576,4 @@ }

});
if (this.isSinglecast() &&
!(0, core_1.supervisedCommandSucceeded)(result)) {
if (this.isSinglecast()
&& !(0, core_1.supervisedCommandSucceeded)(result)) {
// Verify the current value after a (short) delay, unless the command was supervised and successful

@@ -590,4 +590,4 @@ this.schedulePoll({ property, propertyKey }, value, {

// Ensure the value is an object with only valid keys
if (!(0, typeguards_1.isObject)(value) ||
!Object.keys(value).every((key) => key in _Types_1.ColorComponentMap)) {
if (!(0, typeguards_1.isObject)(value)
|| !Object.keys(value).every((key) => key in _Types_1.ColorComponentMap)) {
throw new core_1.ZWaveError(`${core_1.CommandClasses[this.ccId]}: "${property}" must be set to an object which specifies each color channel`, core_1.ZWaveErrorCodes.Argument_Invalid);

@@ -603,3 +603,4 @@ }

if (this.isSinglecast()) {
const supportedColors = this.tryGetValueDB()?.getValue(exports.ColorSwitchCCValues.supportedColorComponents.endpoint(this.endpoint.index));
const supportedColors = this.tryGetValueDB()?.getValue(exports.ColorSwitchCCValues.supportedColorComponents
.endpoint(this.endpoint.index));
if (supportedColors) {

@@ -693,5 +694,7 @@ value = (0, safe_1.pick)(value, supportedColors

for (const color of supportedColors) {
const currentColorChannelValue = exports.ColorSwitchCCValues.currentColorChannel(color);
const currentColorChannelValue = exports.ColorSwitchCCValues
.currentColorChannel(color);
this.setMetadata(applHost, currentColorChannelValue);
const targetColorChannelValue = exports.ColorSwitchCCValues.targetColorChannel(color);
const targetColorChannelValue = exports.ColorSwitchCCValues
.targetColorChannel(color);
this.setMetadata(applHost, targetColorChannelValue);

@@ -742,4 +745,4 @@ }

translatePropertyKey(applHost, property, propertyKey) {
if ((property === "currentColor" || property === "targetColor") &&
typeof propertyKey === "number") {
if ((property === "currentColor" || property === "targetColor")
&& typeof propertyKey === "number") {
const translated = _Types_1.ColorComponent[propertyKey];

@@ -819,14 +822,14 @@ if (translated)

const supportsHex = !!this.getValue(applHost, exports.ColorSwitchCCValues.supportsHexColor);
if (supportsHex &&
(this.colorComponent === _Types_1.ColorComponent.Red ||
this.colorComponent === _Types_1.ColorComponent.Green ||
this.colorComponent === _Types_1.ColorComponent.Blue)) {
if (supportsHex
&& (this.colorComponent === _Types_1.ColorComponent.Red
|| this.colorComponent === _Types_1.ColorComponent.Green
|| this.colorComponent === _Types_1.ColorComponent.Blue)) {
const hexColorValue = exports.ColorSwitchCCValues.hexColor;
const hexValue = this.getValue(applHost, hexColorValue) ?? "000000";
const hexValue = this.getValue(applHost, hexColorValue)
?? "000000";
const byteOffset = _Types_1.ColorComponent.Blue - this.colorComponent;
const byteMask = 0xff << (byteOffset * 8);
let hexValueNumeric = parseInt(hexValue, 16);
hexValueNumeric =
(hexValueNumeric & ~byteMask) |
(this.currentValue << (byteOffset * 8));
hexValueNumeric = (hexValueNumeric & ~byteMask)
| (this.currentValue << (byteOffset * 8));
this.setValue(applHost, hexColorValue, hexValueNumeric.toString(16).padStart(6, "0"));

@@ -984,4 +987,4 @@ }

serialize() {
const controlByte = (_Types_1.LevelChangeDirection[this.direction] << 6) |
(this.ignoreStartLevel ? 32 : 0);
const controlByte = (_Types_1.LevelChangeDirection[this.direction] << 6)
| (this.ignoreStartLevel ? 32 : 0);
const payload = [controlByte, this.colorComponent, this.startLevel];

@@ -988,0 +991,0 @@ if (this.version >= 3) {

/// <reference types="node" />
import type { ParamInfoMap } from "@zwave-js/config";
import { CommandClasses, ConfigValueFormat, ZWaveError, ZWaveErrorCodes, type ConfigurationMetadata, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type ValueID } from "@zwave-js/core/safe";
import { CommandClasses, ConfigValueFormat, type ConfigurationMetadata, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type ValueID, ZWaveError, ZWaveErrorCodes } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ConfigurationCommand, type ConfigValue } from "../lib/_Types";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type ConfigValue, ConfigurationCommand } from "../lib/_Types";
export declare class ConfigurationCCError extends ZWaveError {

@@ -9,0 +9,0 @@ readonly message: string;

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CRC16Command } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare class CRC16CCAPI extends CCAPI {

@@ -43,4 +43,4 @@ "use strict";

static requiresEncapsulation(cc) {
return (!!(cc.encapsulationFlags & safe_1.EncapsulationFlags.CRC16) &&
!(cc instanceof CRC16CCCommandEncapsulation));
return (!!(cc.encapsulationFlags & safe_1.EncapsulationFlags.CRC16)
&& !(cc instanceof CRC16CCCommandEncapsulation));
}

@@ -55,4 +55,4 @@ /** Encapsulates a command in a CRC-16 CC */

// but omit CRC-16, since we're doing that right now
ret.encapsulationFlags =
cc.encapsulationFlags & ~safe_1.EncapsulationFlags.CRC16;
ret.encapsulationFlags = cc.encapsulationFlags
& ~safe_1.EncapsulationFlags.CRC16;
return ret;

@@ -59,0 +59,0 @@ }

/// <reference types="node" />
import { CommandClasses, Duration, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, PhysicalCCAPI, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { DoorLockCommand, DoorLockMode, DoorLockOperationType, type DoorHandleStatus } from "../lib/_Types";
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type DoorHandleStatus, DoorLockCommand, DoorLockMode, DoorLockOperationType } from "../lib/_Types";
export declare const DoorLockCCValues: Readonly<{

@@ -8,0 +8,0 @@ doorStatus: {

@@ -376,4 +376,4 @@ "use strict";

}
else if (typeof property === "string" &&
configurationSetParameters.includes(property)) {
else if (typeof property === "string"
&& configurationSetParameters.includes(property)) {
// checking every type here would create a LOT of duplicate code, so we don't

@@ -862,4 +862,4 @@ // ConfigurationSet expects all parameters --> read the others from cache

if (lockTimeoutMinutes <= 0xfd && lockTimeoutSeconds <= 59) {
this.lockTimeoutConfiguration =
lockTimeoutSeconds + lockTimeoutMinutes * 60;
this.lockTimeoutConfiguration = lockTimeoutSeconds
+ lockTimeoutMinutes * 60;
}

@@ -900,4 +900,6 @@ }

"operation type": (0, safe_2.getEnumMemberName)(_Types_1.DoorLockOperationType, this.operationType),
"outside handle configuration": this.outsideHandlesCanOpenDoorConfiguration.join(", "),
"inside handle configuration": this.insideHandlesCanOpenDoorConfiguration.join(", "),
"outside handle configuration": this
.outsideHandlesCanOpenDoorConfiguration.join(", "),
"inside handle configuration": this
.insideHandlesCanOpenDoorConfiguration.join(", "),
};

@@ -991,8 +993,9 @@ if (this.lockTimeoutConfiguration != undefined) {

]);
if (this.version >= 4 &&
(this.twistAssist != undefined ||
this.blockToBlock != undefined ||
this.autoRelockTime != undefined ||
this.holdAndReleaseTime != undefined)) {
const flags = (this.twistAssist ? 0b1 : 0) | (this.blockToBlock ? 0b10 : 0);
if (this.version >= 4
&& (this.twistAssist != undefined
|| this.blockToBlock != undefined
|| this.autoRelockTime != undefined
|| this.holdAndReleaseTime != undefined)) {
const flags = (this.twistAssist ? 0b1 : 0)
| (this.blockToBlock ? 0b10 : 0);
this.payload = Buffer.concat([

@@ -999,0 +1002,0 @@ this.payload,

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { DoorLockLoggingCommand, type DoorLockLoggingRecord } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const DoorLockLoggingCCValues: Readonly<{

@@ -185,4 +185,4 @@ "use strict";

function eventTypeToLabel(eventType) {
return (eventTypeLabel[_Types_1.DoorLockLoggingEventType[eventType]] ??
`Unknown ${(0, safe_2.num2hex)(eventType)}`);
return (eventTypeLabel[_Types_1.DoorLockLoggingEventType[eventType]]
?? `Unknown ${(0, safe_2.num2hex)(eventType)}`);
}

@@ -263,4 +263,4 @@ let DoorLockLoggingCCRecordsSupportedGet = exports.DoorLockLoggingCCRecordsSupportedGet = class DoorLockLoggingCCRecordsSupportedGet extends DoorLockLoggingCC {

function testResponseForDoorLockLoggingRecordGet(sent, received) {
return (sent.recordNumber === LATEST_RECORD_NUMBER_KEY ||
sent.recordNumber === received.recordNumber);
return (sent.recordNumber === LATEST_RECORD_NUMBER_KEY
|| sent.recordNumber === received.recordNumber);
}

@@ -267,0 +267,0 @@ let DoorLockLoggingCCRecordGet = exports.DoorLockLoggingCCRecordGet = class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC {

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI, POLL_VALUE, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { EnergyProductionCommand, EnergyProductionParameter, type EnergyProductionScale } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const EnergyProductionCCValues: Readonly<{

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { EntryControlCommand, EntryControlDataTypes, EntryControlEventTypes } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const EntryControlCCValues: Readonly<{

@@ -352,6 +352,5 @@ "use strict";

default:
message["event data"] =
typeof this.eventData === "string"
? this.eventData
: (0, safe_2.buffer2hex)(this.eventData);
message["event data"] = typeof this.eventData === "string"
? this.eventData
: (0, safe_2.buffer2hex)(this.eventData);
}

@@ -414,4 +413,4 @@ }

this.maxKeyCacheSize = this.payload[offset + 1];
(0, safe_1.validatePayload)(this.maxKeyCacheSize >= this.minKeyCacheSize &&
this.maxKeyCacheSize <= 32);
(0, safe_1.validatePayload)(this.maxKeyCacheSize >= this.minKeyCacheSize
&& this.maxKeyCacheSize <= 32);
this.minKeyCacheTimeout = this.payload[offset + 2];

@@ -418,0 +417,0 @@ this.maxKeyCacheTimeout = this.payload[offset + 3];

@@ -6,4 +6,4 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { FirmwareDownloadStatus, FirmwareUpdateActivationStatus, FirmwareUpdateMetaDataCommand, FirmwareUpdateRequestStatus, FirmwareUpdateStatus, type FirmwareUpdateMetaData } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { FirmwareDownloadStatus, FirmwareUpdateActivationStatus, type FirmwareUpdateMetaData, FirmwareUpdateMetaDataCommand, FirmwareUpdateRequestStatus, FirmwareUpdateStatus } from "../lib/_Types";
export declare const FirmwareUpdateMetaDataCCValues: Readonly<{

@@ -10,0 +10,0 @@ continuesToFunction: {

@@ -230,5 +230,6 @@ "use strict";

case _Types_1.FirmwareUpdateMetaDataCommand.ActivationSet:
return (this.version >= 4 &&
(this.version < 7 ||
this.tryGetValueDB()?.getValue(exports.FirmwareUpdateMetaDataCCValues.supportsActivation.endpoint(this.endpoint.index)) === true));
return (this.version >= 4
&& (this.version < 7
|| this.tryGetValueDB()?.getValue(exports.FirmwareUpdateMetaDataCCValues
.supportsActivation.endpoint(this.endpoint.index)) === true));
case _Types_1.FirmwareUpdateMetaDataCommand.PrepareGet:

@@ -283,4 +284,4 @@ return this.version >= 5;

});
const { status } = await this.applHost.waitForCommand((cc) => cc instanceof FirmwareUpdateMetaDataCCRequestReport &&
cc.nodeId === this.endpoint.nodeId, 60000);
const { status } = await this.applHost.waitForCommand((cc) => cc instanceof FirmwareUpdateMetaDataCCRequestReport
&& cc.nodeId === this.endpoint.nodeId, 60000);
return status;

@@ -388,4 +389,4 @@ }

// V1/V2 only have a single firmware which must be upgradable
this.firmwareUpgradable =
this.payload[6] === 0xff || this.payload[6] == undefined;
this.firmwareUpgradable = this.payload[6] === 0xff
|| this.payload[6] == undefined;
if (this.version >= 3 && this.payload.length >= 10) {

@@ -410,4 +411,5 @@ this.maxFragmentSize = this.payload.readUInt16BE(8);

this.continuesToFunction = !!(capabilities & 0b1);
if (this.version >= 7)
if (this.version >= 7) {
this.supportsActivation = !!(capabilities & 0b10);
}
}

@@ -504,7 +506,9 @@ }

serialize() {
const isV3 = this.version >= 3 &&
this.firmwareTarget != undefined &&
this.fragmentSize != undefined;
const isV3 = this.version >= 3
&& this.firmwareTarget != undefined
&& this.fragmentSize != undefined;
const isV4 = isV3 && this.version >= 4 && this.activation != undefined;
const isV5 = isV4 && this.version >= 5 && this.hardwareVersion != undefined;
const isV5 = isV4
&& this.version >= 5
&& this.hardwareVersion != undefined;
this.payload = Buffer.allocUnsafe(6 + (isV3 ? 3 : 0) + (isV4 ? 1 : 0) + (isV5 ? 1 : 0));

@@ -511,0 +515,0 @@ this.payload.writeUInt16BE(this.manufacturerId, 0);

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { HumidityControlMode, HumidityControlModeCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const HumidityControlModeCCValues: Readonly<{

@@ -169,4 +169,4 @@ "use strict";

endpoint: this.endpointIndex,
message: "received current humidity control mode: " +
(0, safe_2.getEnumMemberName)(_Types_1.HumidityControlMode, currentMode),
message: "received current humidity control mode: "
+ (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlMode, currentMode),
direction: "inbound",

@@ -173,0 +173,0 @@ });

@@ -87,4 +87,4 @@ "use strict";

endpoint: this.endpointIndex,
message: "received current humidity control operating state: " +
(0, safe_2.getEnumMemberName)(_Types_1.HumidityControlOperatingState, currentStatus),
message: "received current humidity control operating state: "
+ (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlOperatingState, currentStatus),
direction: "inbound",

@@ -91,0 +91,0 @@ });

@@ -5,5 +5,5 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointCapabilities, type HumidityControlSetpointValue } from "../lib/_Types";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type HumidityControlSetpointCapabilities, HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointValue } from "../lib/_Types";
export declare const HumidityControlSetpointCCValues: Readonly<{

@@ -10,0 +10,0 @@ setpointScale: ((setpointType: number) => {

@@ -113,9 +113,9 @@ "use strict";

return response.type === _Types_1.HumidityControlSetpointType["N/A"]
? // not supported
undefined
: // supported
{
value: response.value,
scale: response.scale,
};
// not supported
? undefined
// supported
: {
value: response.value,
scale: response.scale,
};
}

@@ -210,4 +210,4 @@ async set(setpointType, value, scale) {

setpointTypes = [...resp];
const logMessage = "received supported setpoint types:\n" +
setpointTypes
const logMessage = "received supported setpoint types:\n"
+ setpointTypes
.map((type) => (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type))

@@ -249,3 +249,4 @@ .map((name) => `· ${name}`)

});
const scaleValue = exports.HumidityControlSetpointCCValues.setpointScale(type);
const scaleValue = exports.HumidityControlSetpointCCValues
.setpointScale(type);
const states = {};

@@ -298,3 +299,4 @@ for (const scale of setpointScaleSupported) {

if (setpoint) {
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(applHost.configManager, setpoint.scale).unit ?? ""}`;
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(applHost.configManager, setpoint.scale).unit
?? ""}`;
applHost.controllerLog.logNode(node.id, {

@@ -538,4 +540,4 @@ endpoint: this.endpointIndex,

max: this._maxValue,
unit: getSetpointUnit(applHost.configManager, this._minValueScale) ||
getSetpointUnit(applHost.configManager, this._maxValueScale),
unit: getSetpointUnit(applHost.configManager, this._minValueScale)
|| getSetpointUnit(applHost.configManager, this._maxValueScale),
});

@@ -542,0 +544,0 @@ return true;

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { InclusionControllerCommand, InclusionControllerStatus, InclusionControllerStep } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare class InclusionControllerCC extends CommandClass {

@@ -27,4 +27,4 @@ export { AlarmSensorCC, AlarmSensorCCGet, AlarmSensorCCReport, AlarmSensorCCSupportedGet, AlarmSensorCCSupportedReport, AlarmSensorCCValues, } from "./AlarmSensorCC";

export { IndicatorCC, IndicatorCCDescriptionGet, IndicatorCCDescriptionReport, IndicatorCCGet, IndicatorCCReport, IndicatorCCSet, IndicatorCCSupportedGet, IndicatorCCSupportedReport, IndicatorCCValues, } from "./IndicatorCC";
export type { IrrigationCCSystemConfigSetOptions, IrrigationCCValveConfigSetOptions, } from "./IrrigationCC";
export { IrrigationCC, IrrigationCCSystemConfigGet, IrrigationCCSystemConfigReport, IrrigationCCSystemConfigSet, IrrigationCCSystemInfoGet, IrrigationCCSystemInfoReport, IrrigationCCSystemShutoff, IrrigationCCSystemStatusGet, IrrigationCCSystemStatusReport, IrrigationCCValues, IrrigationCCValveConfigGet, IrrigationCCValveConfigReport, IrrigationCCValveConfigSet, IrrigationCCValveInfoGet, IrrigationCCValveInfoReport, IrrigationCCValveRun, IrrigationCCValveTableGet, IrrigationCCValveTableReport, IrrigationCCValveTableRun, IrrigationCCValveTableSet, } from "./IrrigationCC";
export type { IrrigationCCSystemConfigSetOptions, IrrigationCCValveConfigSetOptions, } from "./IrrigationCC";
export { LanguageCC, LanguageCCGet, LanguageCCReport, LanguageCCSet, LanguageCCValues, } from "./LanguageCC";

@@ -38,4 +38,4 @@ export { LockCC, LockCCGet, LockCCReport, LockCCSet, LockCCValues, } from "./LockCC";

export { MultiCommandCC, MultiCommandCCCommandEncapsulation, } from "./MultiCommandCC";
export type { MultilevelSensorCCReportOptions } from "./MultilevelSensorCC";
export { MultilevelSensorCC, MultilevelSensorCCGet, MultilevelSensorCCGetSupportedScale, MultilevelSensorCCGetSupportedSensor, MultilevelSensorCCReport, MultilevelSensorCCSupportedScaleReport, MultilevelSensorCCSupportedSensorReport, MultilevelSensorCCValues, } from "./MultilevelSensorCC";
export type { MultilevelSensorCCReportOptions } from "./MultilevelSensorCC";
export { MultilevelSwitchCC, MultilevelSwitchCCGet, MultilevelSwitchCCReport, MultilevelSwitchCCSet, MultilevelSwitchCCStartLevelChange, MultilevelSwitchCCStopLevelChange, MultilevelSwitchCCSupportedGet, MultilevelSwitchCCSupportedReport, MultilevelSwitchCCValues, } from "./MultilevelSwitchCC";

@@ -50,4 +50,4 @@ export { NoOperationCC, messageIsPing } from "./NoOperationCC";

export { SceneControllerConfigurationCC, SceneControllerConfigurationCCGet, SceneControllerConfigurationCCReport, SceneControllerConfigurationCCSet, SceneControllerConfigurationCCValues, } from "./SceneControllerConfigurationCC";
export type { ScheduleEntryLockCCDailyRepeatingScheduleSetOptions, ScheduleEntryLockCCWeekDayScheduleSetOptions, ScheduleEntryLockCCYearDayScheduleSetOptions, } from "./ScheduleEntryLockCC";
export { ScheduleEntryLockCC, ScheduleEntryLockCCDailyRepeatingScheduleGet, ScheduleEntryLockCCDailyRepeatingScheduleReport, ScheduleEntryLockCCDailyRepeatingScheduleSet, ScheduleEntryLockCCEnableAllSet, ScheduleEntryLockCCEnableSet, ScheduleEntryLockCCSupportedGet, ScheduleEntryLockCCSupportedReport, ScheduleEntryLockCCTimeOffsetGet, ScheduleEntryLockCCTimeOffsetReport, ScheduleEntryLockCCTimeOffsetSet, ScheduleEntryLockCCValues, ScheduleEntryLockCCWeekDayScheduleGet, ScheduleEntryLockCCWeekDayScheduleReport, ScheduleEntryLockCCWeekDayScheduleSet, ScheduleEntryLockCCYearDayScheduleGet, ScheduleEntryLockCCYearDayScheduleReport, ScheduleEntryLockCCYearDayScheduleSet, } from "./ScheduleEntryLockCC";
export type { ScheduleEntryLockCCDailyRepeatingScheduleSetOptions, ScheduleEntryLockCCWeekDayScheduleSetOptions, ScheduleEntryLockCCYearDayScheduleSetOptions, } from "./ScheduleEntryLockCC";
export { Security2CC, Security2CCCommandsSupportedGet, Security2CCCommandsSupportedReport, Security2CCKEXFail, Security2CCKEXGet, Security2CCKEXReport, Security2CCKEXSet, Security2CCMessageEncapsulation, Security2CCNetworkKeyGet, Security2CCNetworkKeyReport, Security2CCNetworkKeyVerify, Security2CCNonceGet, Security2CCNonceReport, Security2CCPublicKeyReport, Security2CCTransferEnd, } from "./Security2CC";

@@ -54,0 +54,0 @@ export { SecurityCC, SecurityCCCommandEncapsulation, SecurityCCCommandEncapsulationNonceGet, SecurityCCCommandsSupportedGet, SecurityCCCommandsSupportedReport, SecurityCCNetworkKeySet, SecurityCCNetworkKeyVerify, SecurityCCNonceGet, SecurityCCNonceReport, SecurityCCSchemeGet, SecurityCCSchemeInherit, SecurityCCSchemeReport, } from "./SecurityCC";

/// <reference types="node" />
import { CommandClasses, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { IndicatorCommand, type IndicatorTimeout } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const IndicatorCCValues: Readonly<{

@@ -157,11 +157,11 @@ "use strict";

return undefined;
const hours = (timeoutValues.find((v) => v.propertyId === 0x0a)?.value ??
0);
const minutes = (timeoutValues.find((v) => v.propertyId === 0x06)?.value ??
0);
const hours = (timeoutValues.find((v) => v.propertyId === 0x0a)?.value
?? 0);
const minutes = (timeoutValues.find((v) => v.propertyId === 0x06)?.value
?? 0);
const seconds = (0, math_1.clamp)(timeoutValues.find((v) => v.propertyId === 0x07)
?.value ?? 0, 0, 59) +
(0, math_1.clamp)(timeoutValues.find((v) => v.propertyId === 0x08)
?.value ?? 0, 0, 99) /
100;
?.value ?? 0, 0, 59)
+ (0, math_1.clamp)(timeoutValues.find((v) => v.propertyId === 0x08)
?.value ?? 0, 0, 99)
/ 100;
return {

@@ -199,4 +199,4 @@ hours,

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses.Indicator, {
...Values_1.V.dynamicPropertyAndKeyWithName("supportedPropertyIDs", "supportedPropertyIDs", (indicatorId) => indicatorId, ({ property, propertyKey }) => property === "supportedPropertyIDs" &&
typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyAndKeyWithName("supportedPropertyIDs", "supportedPropertyIDs", (indicatorId) => indicatorId, ({ property, propertyKey }) => property === "supportedPropertyIDs"
&& typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyAndKeyWithName("valueV2",

@@ -221,3 +221,4 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars

function getIndicatorMetadata(configManager, indicatorId, propertyId, overrideIndicatorLabel) {
const label = overrideIndicatorLabel || configManager.lookupIndicator(indicatorId);
const label = overrideIndicatorLabel
|| configManager.lookupIndicator(indicatorId);
const prop = configManager.lookupProperty(propertyId);

@@ -295,4 +296,4 @@ const baseMetadata = exports.IndicatorCCValues.valueV2(indicatorId, propertyId).meta;

}
else if (typeof property === "number" &&
typeof propertyKey === "number") {
else if (typeof property === "number"
&& typeof propertyKey === "number") {
const indicatorId = property;

@@ -566,3 +567,4 @@ const propertyId = propertyKey;

if (this.version >= 4) {
const manufacturerDefinedIndicatorIds = supportedIndicatorIds.filter((id) => isManufacturerDefinedIndicator(id));
const manufacturerDefinedIndicatorIds = supportedIndicatorIds
.filter((id) => isManufacturerDefinedIndicator(id));
if (manufacturerDefinedIndicatorIds.length > 0) {

@@ -616,4 +618,4 @@ applHost.controllerLog.logNode(node.id, {

}
else if (typeof property === "number" &&
typeof propertyKey === "number") {
else if (typeof property === "number"
&& typeof propertyKey === "number") {
// The indicator property is our property key

@@ -659,3 +661,5 @@ const prop = applHost.configManager.lookupProperty(propertyKey);

(0, safe_1.validatePayload)(this.payload.length >= 1);
const objCount = this.payload.length >= 2 ? this.payload[1] & 0b11111 : 0;
const objCount = this.payload.length >= 2
? this.payload[1] & 0b11111
: 0;
if (objCount === 0) {

@@ -681,3 +685,4 @@ this.indicator0Value = this.payload[0];

if (!("value" in options)) {
throw new safe_1.ZWaveError(`Node ${this.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
throw new safe_1.ZWaveError(`Node ${this
.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
}

@@ -711,4 +716,7 @@ this.indicator0Value = options.value;

const value = this.values[i].value;
this.payload[offset + 2] =
value === true ? 0xff : value === false ? 0x00 : value;
this.payload[offset + 2] = value === true
? 0xff
: value === false
? 0x00
: value;
}

@@ -750,3 +758,5 @@ }

(0, safe_1.validatePayload)(this.payload.length >= 1);
const objCount = this.payload.length >= 2 ? this.payload[1] & 0b11111 : 0;
const objCount = this.payload.length >= 2
? this.payload[1] & 0b11111
: 0;
if (objCount === 0) {

@@ -874,4 +884,7 @@ this.indicator0Value = this.payload[0];

const value = this.values[i].value;
this.payload[offset + 2] =
value === true ? 0xff : value === false ? 0x00 : value;
this.payload[offset + 2] = value === true
? 0xff
: value === false
? 0x00
: value;
}

@@ -990,4 +1003,4 @@ }

"supported properties": `${this.supportedProperties
.map((id) => applHost.configManager.lookupProperty(id)?.label ??
`Unknown (${(0, safe_2.num2hex)(id)})`)
.map((id) => applHost.configManager.lookupProperty(id)?.label
?? `Unknown (${(0, safe_2.num2hex)(id)})`)
.join(", ")}`,

@@ -994,0 +1007,0 @@ "next indicator": getIndicatorName(applHost.configManager, this.nextIndicatorId),

/// <reference types="node" />
import { CommandClasses, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type ValueID } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { IrrigationCommand, IrrigationSensorPolarity, type ValveId, type ValveTableEntry } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const IrrigationCCValues: Readonly<{

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { LanguageCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const LanguageCCValues: Readonly<{

@@ -158,4 +158,4 @@ "use strict";

set country(value) {
if (typeof value === "string" &&
(value.length !== 2 || value.toUpperCase() !== value)) {
if (typeof value === "string"
&& (value.length !== 2 || value.toUpperCase() !== value)) {
throw new safe_1.ZWaveError("country must be a 2 digit (uppercase) code according to ISO 3166-1", safe_1.ZWaveErrorCodes.Argument_Invalid);

@@ -162,0 +162,0 @@ }

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, PhysicalCCAPI, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { LockCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const LockCCValues: Readonly<{

/// <reference types="node" />
import { ValueMetadata, type MaybeUnknown, type MessageOrCCLogEntry, type ValueID } from "@zwave-js/core/safe";
import { type MaybeUnknown, type MessageOrCCLogEntry, type ValueID, ValueMetadata } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../../lib/API";
import { POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../../lib/API";
import { type CCCommandOptions, type CommandClassDeserializationOptions } from "../../lib/CommandClass";

@@ -6,0 +6,0 @@ import { ManufacturerProprietaryCC, ManufacturerProprietaryCCAPI } from "../ManufacturerProprietaryCC";

@@ -157,4 +157,4 @@ "use strict";

const FibaroConstructor = (0, Decorators_1.getFibaroCCCommandConstructor)(this.fibaroCCId, this.fibaroCCCommand);
if (FibaroConstructor &&
new.target !== FibaroConstructor) {
if (FibaroConstructor
&& new.target !== FibaroConstructor) {
return new FibaroConstructor(host, options);

@@ -233,4 +233,4 @@ }

if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
if (this.fibaroCCCommand === FibaroVenetianBlindCCCommand.Report &&
new.target !== FibaroVenetianBlindCCReport) {
if (this.fibaroCCCommand === FibaroVenetianBlindCCCommand.Report
&& new.target !== FibaroVenetianBlindCCReport) {
return new FibaroVenetianBlindCCReport(host, options);

@@ -290,4 +290,4 @@ }

serialize() {
const controlByte = (this.position != undefined ? 0b10 : 0) |
(this.tilt != undefined ? 0b01 : 0);
const controlByte = (this.position != undefined ? 0b10 : 0)
| (this.tilt != undefined ? 0b01 : 0);
this.payload = Buffer.from([

@@ -294,0 +294,0 @@ controlByte,

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
export type ManufacturerProprietaryCCConstructor<T extends typeof ManufacturerProprietaryCC = typeof ManufacturerProprietaryCC> = T & {

@@ -8,0 +8,0 @@ new (host: ZWaveHost, options: any): InstanceType<T>;

@@ -51,4 +51,4 @@ "use strict";

const SpecificAPIConstructor = (0, Decorators_1.getManufacturerProprietaryAPI)(manufacturerId);
if (SpecificAPIConstructor != undefined &&
new.target !== SpecificAPIConstructor) {
if (SpecificAPIConstructor != undefined
&& new.target !== SpecificAPIConstructor) {
return new SpecificAPIConstructor(applHost, endpoint);

@@ -106,9 +106,9 @@ }

// ManufacturerProprietaryCC has no CC command, so the first byte is stored in ccCommand.
this.manufacturerId =
(this.ccCommand << 8) + this.payload[0];
this.manufacturerId = (this.ccCommand << 8)
+ this.payload[0];
// Try to parse the proprietary command
const PCConstructor = (0, Decorators_1.getManufacturerProprietaryCCConstructor)(this.manufacturerId);
if (PCConstructor &&
new.target !== PCConstructor &&
!(0, safe_2.staticExtends)(new.target, PCConstructor)) {
if (PCConstructor
&& new.target !== PCConstructor
&& !(0, safe_2.staticExtends)(new.target, PCConstructor)) {
return new PCConstructor(host, options);

@@ -120,4 +120,4 @@ }

else {
this.manufacturerId =
options.manufacturerId ?? (0, Decorators_1.getManufacturerId)(this);
this.manufacturerId = options.manufacturerId
?? (0, Decorators_1.getManufacturerId)(this);
this.unspecifiedExpectsResponse =

@@ -124,0 +124,0 @@ options.unspecifiedExpectsResponse;

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { DeviceIdType, ManufacturerSpecificCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const ManufacturerSpecificCCValues: Readonly<{

@@ -45,5 +45,5 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Manufacturer Specific"], {
...Values_1.V.dynamicPropertyAndKeyWithName("deviceId", "deviceId", (type) => (0, safe_2.getEnumMemberName)(_Types_1.DeviceIdType, type), ({ property, propertyKey }) => property === "deviceId" &&
typeof propertyKey === "string" &&
propertyKey in _Types_1.DeviceIdType, (type) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("deviceId", "deviceId", (type) => (0, safe_2.getEnumMemberName)(_Types_1.DeviceIdType, type), ({ property, propertyKey }) => property === "deviceId"
&& typeof propertyKey === "string"
&& propertyKey in _Types_1.DeviceIdType, (type) => ({
...safe_1.ValueMetadata.ReadOnlyString,

@@ -119,4 +119,4 @@ label: `Device ID (${(0, safe_2.getEnumMemberName)(_Types_1.DeviceIdType, type)})`,

const logMessage = `received response for manufacturer information:
manufacturer: ${applHost.configManager.lookupManufacturer(mfResp.manufacturerId) ||
"unknown"} (${(0, safe_2.num2hex)(mfResp.manufacturerId)})
manufacturer: ${applHost.configManager.lookupManufacturer(mfResp.manufacturerId)
|| "unknown"} (${(0, safe_2.num2hex)(mfResp.manufacturerId)})
product type: ${(0, safe_2.num2hex)(mfResp.productType)}

@@ -200,6 +200,5 @@ product id: ${(0, safe_2.num2hex)(mfResp.productId)}`;

const deviceIdData = this.payload.slice(2, 2 + dataLength);
this.deviceId =
dataFormat === 0
? deviceIdData.toString("utf8")
: "0x" + deviceIdData.toString("hex");
this.deviceId = dataFormat === 0
? deviceIdData.toString("utf8")
: "0x" + deviceIdData.toString("hex");
}

@@ -206,0 +205,0 @@ toLogEntry(applHost) {

@@ -6,4 +6,4 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, PhysicalCCAPI, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { MeterCommand, RateType } from "../lib/_Types";

@@ -259,16 +259,20 @@ export declare const MeterCCValues: Readonly<{

}
export interface MeterCCReportOptions extends CCCommandOptions {
type: number;
scale: number;
value: number;
previousValue?: MaybeNotKnown<number>;
rateType?: RateType;
deltaTime?: MaybeUnknown<number>;
}
export declare class MeterCCReport extends MeterCC {
constructor(host: ZWaveHost, options: CommandClassDeserializationOptions);
constructor(host: ZWaveHost, options: CommandClassDeserializationOptions | MeterCCReportOptions);
persistValues(applHost: ZWaveApplicationHost): boolean;
private _type;
get type(): number;
readonly scale: number;
private _value;
get value(): number;
private _previousValue;
get previousValue(): MaybeNotKnown<number>;
private _rateType;
get rateType(): RateType;
private _deltaTime;
get deltaTime(): MaybeUnknown<number>;
type: number;
scale: number;
value: number;
previousValue: MaybeNotKnown<number>;
rateType: RateType;
deltaTime: MaybeUnknown<number>;
serialize(): Buffer;
toLogEntry(applHost: ZWaveApplicationHost): MessageOrCCLogEntry;

@@ -275,0 +279,0 @@ }

@@ -307,4 +307,4 @@ "use strict";

}
else if (propertyKey != undefined &&
typeof propertyKey !== "number") {
else if (propertyKey != undefined
&& typeof propertyKey !== "number") {
(0, API_1.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);

@@ -397,3 +397,4 @@ }

else {
const type = this.getValue(applHost, exports.MeterCCValues.type) ?? 0;
const type = this.getValue(applHost, exports.MeterCCValues.type)
?? 0;
const supportedScales = this.getValue(applHost, exports.MeterCCValues.supportedScales) ?? [];

@@ -428,4 +429,4 @@ const supportedRateTypes = this.getValue(applHost, exports.MeterCCValues.supportedRateTypes) ?? [];

const lastUpdated = valueDB.getTimestamp(v);
return (lastUpdated == undefined ||
Date.now() - lastUpdated > core_1.timespan.hours(6));
return (lastUpdated == undefined
|| Date.now() - lastUpdated > core_1.timespan.hours(6));
});

@@ -499,42 +500,52 @@ }

super(host, options);
(0, safe_1.validatePayload)(this.payload.length >= 2);
this._type = this.payload[0] & 31;
this._rateType = (this.payload[0] & 96) >>> 5;
const scale1Bit2 = (this.payload[0] & 128) >>> 7;
const { scale: scale1Bits10, value, bytesRead, } = (0, safe_1.parseFloatWithScale)(this.payload.slice(1));
let offset = 2 + (bytesRead - 1);
// The scale is composed of two fields (see SDS13781)
const scale1 = (scale1Bit2 << 2) | scale1Bits10;
let scale2 = 0;
this._value = value;
if (this.version >= 2 && this.payload.length >= offset + 2) {
this._deltaTime = this.payload.readUInt16BE(offset);
offset += 2;
if (this._deltaTime === 0xffff) {
this._deltaTime = safe_1.UNKNOWN_STATE;
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
(0, safe_1.validatePayload)(this.payload.length >= 2);
this.type = this.payload[0] & 31;
this.rateType = (this.payload[0] & 96) >>> 5;
const scale1Bit2 = (this.payload[0] & 128) >>> 7;
const { scale: scale1Bits10, value, bytesRead, } = (0, safe_1.parseFloatWithScale)(this.payload.slice(1));
let offset = 2 + (bytesRead - 1);
// The scale is composed of two fields (see SDS13781)
const scale1 = (scale1Bit2 << 2) | scale1Bits10;
let scale2 = 0;
this.value = value;
if (this.version >= 2 && this.payload.length >= offset + 2) {
this.deltaTime = this.payload.readUInt16BE(offset);
offset += 2;
if (this.deltaTime === 0xffff) {
this.deltaTime = safe_1.UNKNOWN_STATE;
}
if (
// 0 means that no previous value is included
this.deltaTime !== 0
&& this.payload.length >= offset + (bytesRead - 1)) {
const { value: prevValue } = (0, safe_1.parseFloatWithScale)(
// This float is split in the payload
Buffer.concat([
Buffer.from([this.payload[1]]),
this.payload.slice(offset),
]));
offset += bytesRead - 1;
this.previousValue = prevValue;
}
if (this.version >= 4
&& scale1 === 7
&& this.payload.length >= offset + 1) {
scale2 = this.payload[offset];
}
}
if (
// 0 means that no previous value is included
this.deltaTime !== 0 &&
this.payload.length >= offset + (bytesRead - 1)) {
const { value: prevValue } = (0, safe_1.parseFloatWithScale)(
// This float is split in the payload
Buffer.concat([
Buffer.from([this.payload[1]]),
this.payload.slice(offset),
]));
offset += bytesRead - 1;
this._previousValue = prevValue;
else {
// 0 means that no previous value is included
this.deltaTime = 0;
}
if (this.version >= 4 &&
scale1 === 7 &&
this.payload.length >= offset + 1) {
scale2 = this.payload[offset];
}
this.scale = scale1 === 7 ? scale1 + scale2 : scale1;
}
else {
// 0 means that no previous value is included
this._deltaTime = 0;
this.type = options.type;
this.scale = options.scale;
this.value = options.value;
this.previousValue = options.previousValue;
this.rateType = options.rateType ?? _Types_1.RateType.Unspecified;
this.deltaTime = options.deltaTime ?? safe_1.UNKNOWN_STATE;
}
this.scale = scale1 === 7 ? scale1 + scale2 : scale1;
}

@@ -544,4 +555,4 @@ persistValues(applHost) {

return false;
const meterType = applHost.configManager.lookupMeter(this._type);
const scale = applHost.configManager.lookupMeterScale(this._type, this.scale);
const meterType = applHost.configManager.lookupMeter(this.type);
const scale = applHost.configManager.lookupMeterScale(this.type, this.scale);
// Filter out unknown meter types and scales, unless the strict validation is disabled

@@ -556,3 +567,3 @@ const measurementValidation = !this.host.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;

if (expectedType != undefined) {
safe_1.validatePayload.withReason("Unexpected meter type or corrupted data")(this._type === expectedType);
safe_1.validatePayload.withReason("Unexpected meter type or corrupted data")(this.type === expectedType);
}

@@ -565,49 +576,59 @@ const supportedScales = this.getValue(applHost, exports.MeterCCValues.supportedScales);

if (supportedRateTypes?.length) {
safe_1.validatePayload.withReason(`Unsupported rate type ${(0, safe_2.getEnumMemberName)(_Types_1.RateType, this._rateType)} or corrupted data`)(supportedRateTypes.includes(this._rateType));
safe_1.validatePayload.withReason(`Unsupported rate type ${(0, safe_2.getEnumMemberName)(_Types_1.RateType, this.rateType)} or corrupted data`)(supportedRateTypes.includes(this.rateType));
}
}
}
const valueValue = exports.MeterCCValues.value(this._type, this._rateType, this.scale);
const valueValue = exports.MeterCCValues.value(this.type, this.rateType, this.scale);
this.setMetadata(applHost, valueValue, {
...valueValue.meta,
label: getValueLabel(applHost.configManager, this._type, scale, this._rateType),
label: getValueLabel(applHost.configManager, this.type, scale, this.rateType),
unit: scale.label,
ccSpecific: {
meterType: this._type,
meterType: this.type,
scale: this.scale,
rateType: this._rateType,
rateType: this.rateType,
},
});
this.setValue(applHost, valueValue, this._value);
this.setValue(applHost, valueValue, this.value);
return true;
}
get type() {
return this._type;
serialize() {
const scale1 = this.scale >= 7 ? 7 : this.scale & 0b111;
const scale1Bits10 = scale1 & 0b11;
const scale1Bit2 = scale1 >>> 2;
const scale2 = this.scale >= 7 ? this.scale - 7 : 0;
const typeByte = (this.type & 31)
| ((this.rateType & 0b11) << 5)
| (scale1Bit2 << 7);
const floatParams = (0, core_1.getFloatParameters)(this.value);
const valueBytes = (0, core_1.encodeFloatWithScale)(this.value, scale1Bits10, floatParams);
const prevValueBytes = this.previousValue != undefined
? (0, core_1.encodeFloatWithScale)(this.previousValue, scale1Bits10, floatParams)
: Buffer.from([]);
const deltaTime = this.deltaTime ?? 0xffff;
const deltaTimeBytes = Buffer.allocUnsafe(2);
deltaTimeBytes.writeUInt16BE(deltaTime, 0);
this.payload = Buffer.concat([
Buffer.from([typeByte]),
valueBytes,
deltaTimeBytes,
prevValueBytes,
Buffer.from([scale2]),
]);
return super.serialize();
}
get value() {
return this._value;
}
get previousValue() {
return this._previousValue;
}
get rateType() {
return this._rateType;
}
get deltaTime() {
return this._deltaTime;
}
toLogEntry(applHost) {
const meterType = applHost.configManager.lookupMeter(this._type);
const scale = applHost.configManager.lookupMeterScale(this._type, this.scale);
const meterType = applHost.configManager.lookupMeter(this.type);
const scale = applHost.configManager.lookupMeterScale(this.type, this.scale);
const message = {
type: meterType?.name ?? `Unknown (${(0, safe_2.num2hex)(this._type)})`,
type: meterType?.name ?? `Unknown (${(0, safe_2.num2hex)(this.type)})`,
scale: scale.label,
"rate type": (0, safe_2.getEnumMemberName)(_Types_1.RateType, this._rateType),
"rate type": (0, safe_2.getEnumMemberName)(_Types_1.RateType, this.rateType),
value: this.value,
};
if (this._deltaTime !== safe_1.UNKNOWN_STATE) {
if (this.deltaTime !== safe_1.UNKNOWN_STATE) {
message["time delta"] = `${this.deltaTime} seconds`;
}
if (this._previousValue != undefined) {
message["prev. value"] = this._previousValue;
if (this.previousValue != undefined) {
message["prev. value"] = this.previousValue;
}

@@ -626,4 +647,4 @@ return {

// (if they were requested)
return ((sent.scale == undefined || sent.scale === received.scale) &&
(sent.rateType == undefined || sent.rateType == received.rateType));
return ((sent.scale == undefined || sent.scale === received.scale)
&& (sent.rateType == undefined || sent.rateType == received.rateType));
}

@@ -744,4 +765,4 @@ let MeterCCGet = exports.MeterCCGet = class MeterCCGet extends MeterCC {

const message = {
type: `${applHost.configManager.lookupMeter(this.type)?.name ??
`Unknown (${(0, safe_2.num2hex)(this.type)})`}`,
type: `${applHost.configManager.lookupMeter(this.type)?.name
?? `Unknown (${(0, safe_2.num2hex)(this.type)})`}`,
"supports reset": this.supportsReset,

@@ -794,4 +815,4 @@ "supported scales": `${this.supportedScales

// Test if this is a valid target value
if (this.targetValue != undefined &&
!(0, safe_1.getMinIntegerSize)(this.targetValue, true)) {
if (this.targetValue != undefined
&& !(0, safe_1.getMinIntegerSize)(this.targetValue, true)) {
throw new safe_1.ZWaveError(`${this.targetValue} is not a valid target value!`, safe_1.ZWaveErrorCodes.Argument_Invalid);

@@ -803,5 +824,5 @@ }

if (this.version >= 6 && this.targetValue != undefined && this.type) {
const size = (this.targetValue &&
(0, safe_1.getMinIntegerSize)(this.targetValue, true)) ||
0;
const size = (this.targetValue
&& (0, safe_1.getMinIntegerSize)(this.targetValue, true))
|| 0;
if (size > 0) {

@@ -818,4 +839,4 @@ this.payload = Buffer.allocUnsafe(1 + size);

if (this.type != undefined) {
message.type = `${applHost.configManager.lookupMeter(this.type)?.name ??
`Unknown (${(0, safe_2.num2hex)(this.type)})`}`;
message.type = `${applHost.configManager.lookupMeter(this.type)?.name
?? `Unknown (${(0, safe_2.num2hex)(this.type)})`}`;
}

@@ -822,0 +843,0 @@ if (this.targetValue != undefined) {

@@ -6,4 +6,4 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { MultiChannelAssociationCommand, type AssociationAddress, type EndpointAddress } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type AssociationAddress, type EndpointAddress, MultiChannelAssociationCommand } from "../lib/_Types";
export declare const MultiChannelAssociationCCValues: Readonly<{

@@ -10,0 +10,0 @@ endpoints: ((groupId: number) => {

@@ -305,7 +305,7 @@ "use strict";

// node addresses
nodeAddressBytes +
nodeAddressBytes
// endpoint marker
(endpointAddressBytes > 0 ? 1 : 0) +
+ (endpointAddressBytes > 0 ? 1 : 0)
// endpoints
endpointAddressBytes);
+ endpointAddressBytes);
// write node addresses

@@ -323,6 +323,6 @@ for (let i = 0; i < nodeIds.length; i++) {

const destination = typeof endpoint.endpoint === "number"
? // The destination is a single number
endpoint.endpoint & 127
: // The destination is a bit mask
(0, safe_1.encodeBitMask)(endpoint.endpoint, 7)[0] | 128;
// The destination is a single number
? endpoint.endpoint & 127
// The destination is a bit mask
: (0, safe_1.encodeBitMask)(endpoint.endpoint, 7)[0] | 128;
payload[offset + 2 * i] = endpoint.nodeId;

@@ -420,3 +420,4 @@ payload[offset + 2 * i + 1] = destination;

// We don't want to do too much work, so find out which groups the destination is in
const currentDestinations = MultiChannelAssociationCC.getAllDestinationsCached(this.applHost, this.endpoint);
const currentDestinations = MultiChannelAssociationCC
.getAllDestinationsCached(this.applHost, this.endpoint);
for (const [group, destinations] of currentDestinations) {

@@ -510,5 +511,5 @@ const cc = new MultiChannelAssociationCCRemove(this.applHost, {

// Filter out duplicates
groupDestinations.filter((addr, index) => index ===
groupDestinations.findIndex(({ nodeId, endpoint }) => nodeId === addr.nodeId &&
endpoint === addr.endpoint)));
groupDestinations.filter((addr, index) => index
=== groupDestinations.findIndex(({ nodeId, endpoint }) => nodeId === addr.nodeId
&& endpoint === addr.endpoint)));
}

@@ -566,4 +567,4 @@ return ret;

// Some devices report more association groups than multi channel association groups, so we need this info here
const assocGroupCount = this.getValue(applHost, AssociationCC_1.AssociationCCValues.groupCount) ||
mcGroupCount;
const assocGroupCount = this.getValue(applHost, AssociationCC_1.AssociationCCValues.groupCount)
|| mcGroupCount;
// Then query each multi channel association group

@@ -647,4 +648,4 @@ for (let groupId = 1; groupId <= mcGroupCount; groupId++) {

}
this.endpoints =
("endpoints" in options && options.endpoints) || [];
this.endpoints = ("endpoints" in options && options.endpoints)
|| [];
}

@@ -685,3 +686,4 @@ }

if (this.version === 1) {
throw new safe_1.ZWaveError(`Node ${this.nodeId} only supports MultiChannelAssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
throw new safe_1.ZWaveError(`Node ${this
.nodeId} only supports MultiChannelAssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
}

@@ -688,0 +690,0 @@ }

/// <reference types="node" />
import type { GenericDeviceClass, SpecificDeviceClass } from "@zwave-js/config";
import { CommandClasses, type ApplicationNodeInformation, type MaybeNotKnown, type MessageOrCCLogEntry } from "@zwave-js/core/safe";
import { type ApplicationNodeInformation, CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { MultiChannelCommand } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const MultiChannelCCValues: Readonly<{

@@ -69,3 +69,4 @@ "use strict";

for (const endpoint of endpointIndizes) {
const devClassValueId = exports.MultiChannelCCValues.endpointDeviceClass.endpoint(endpoint);
const devClassValueId = exports.MultiChannelCCValues.endpointDeviceClass
.endpoint(endpoint);
const deviceClass = applHost.getValueDB(node.id).getValue(devClassValueId);

@@ -157,4 +158,6 @@ if (deviceClass) {

if (response) {
const generic = this.applHost.configManager.lookupGenericDeviceClass(response.genericDeviceClass);
const specific = this.applHost.configManager.lookupSpecificDeviceClass(response.genericDeviceClass, response.specificDeviceClass);
const generic = this.applHost.configManager
.lookupGenericDeviceClass(response.genericDeviceClass);
const specific = this.applHost.configManager
.lookupSpecificDeviceClass(response.genericDeviceClass, response.specificDeviceClass);
return {

@@ -230,5 +233,5 @@ isDynamic: response.isDynamic,

static requiresEncapsulation(cc) {
return (cc.endpointIndex !== 0 &&
!(cc instanceof MultiChannelCCCommandEncapsulation) &&
!(cc instanceof MultiChannelCCV1CommandEncapsulation));
return (cc.endpointIndex !== 0
&& !(cc instanceof MultiChannelCCCommandEncapsulation)
&& !(cc instanceof MultiChannelCCV1CommandEncapsulation));
}

@@ -305,3 +308,4 @@ /** Encapsulates a command that targets a specific endpoint */

if (multiResponse.aggregatedEndpointCount != undefined) {
logMessage += `\nendpoint count (aggregated): ${multiResponse.aggregatedEndpointCount}`;
logMessage +=
`\nendpoint count (aggregated): ${multiResponse.aggregatedEndpointCount}`;
}

@@ -315,5 +319,5 @@ applHost.controllerLog.logNode(node.id, {

const addSequentialEndpoints = () => {
for (let i = 1; i <=
multiResponse.individualEndpointCount +
(multiResponse.aggregatedEndpointCount ?? 0); i++) {
for (let i = 1; i
<= multiResponse.individualEndpointCount
+ (multiResponse.aggregatedEndpointCount ?? 0); i++) {
allEndpoints.push(i);

@@ -372,4 +376,4 @@ }

for (const endpoint of allEndpoints) {
if (endpoint > multiResponse.individualEndpointCount &&
this.version >= 4) {
if (endpoint > multiResponse.individualEndpointCount
&& this.version >= 4) {
// Find members of aggregated end point

@@ -415,3 +419,4 @@ applHost.controllerLog.logNode(node.id, {

hasQueriedCapabilities = true;
logMessage = `received response for endpoint capabilities (#${endpoint}):
logMessage =
`received response for endpoint capabilities (#${endpoint}):
generic device class: ${caps.generic.label}

@@ -442,4 +447,4 @@ specific device class: ${caps.specific.label}

// But first figure out if they seem unnecessary and if they do, which ones should be preserved
if (!multiResponse.identicalCapabilities &&
areEndpointsUnnecessary(applHost, node, allEndpoints)) {
if (!multiResponse.identicalCapabilities
&& areEndpointsUnnecessary(applHost, node, allEndpoints)) {
const preserve = applHost.getDeviceConfig?.(node.id)?.compat

@@ -545,4 +550,4 @@ ?.preserveEndpoints;

this.payload = Buffer.from([
(this.countIsDynamic ? 0b10000000 : 0) |
(this.identicalCapabilities ? 0b01000000 : 0),
(this.countIsDynamic ? 0b10000000 : 0)
| (this.identicalCapabilities ? 0b01000000 : 0),
this.individualCount & 0b01111111,

@@ -604,6 +609,5 @@ this.aggregatedCount ?? 0,

// Removal reports have very specific information
this.wasRemoved =
this.isDynamic &&
this.genericDeviceClass === 0xff && // "Non-Interoperable"
this.specificDeviceClass === 0x00;
this.wasRemoved = this.isDynamic
&& this.genericDeviceClass === 0xff // "Non-Interoperable"
&& this.specificDeviceClass === 0x00;
}

@@ -640,4 +644,4 @@ else {

Buffer.from([
(this.endpointIndex & 0b01111111) |
(this.isDynamic ? 0b10000000 : 0),
(this.endpointIndex & 0b01111111)
| (this.isDynamic ? 0b10000000 : 0),
]),

@@ -849,4 +853,4 @@ (0, safe_1.encodeApplicationNodeInformation)(this),

function getCCResponseForCommandEncapsulation(sent) {
if (typeof sent.destination === "number" &&
sent.encapsulated.expectsCCResponse()) {
if (typeof sent.destination === "number"
&& sent.encapsulated.expectsCCResponse()) {
// Allow both versions of the encapsulation command

@@ -861,4 +865,4 @@ // Our implementation check is a bit too strict, so change the return type

function testResponseForCommandEncapsulation(sent, received) {
if (typeof sent.destination === "number" &&
sent.destination === received.endpointIndex) {
if (typeof sent.destination === "number"
&& sent.destination === received.endpointIndex) {
return "checkEncapsulated";

@@ -907,4 +911,5 @@ }

// This device incorrectly responds from the endpoint we've passed as our source endpoint
if (typeof this.destination === "number")
if (typeof this.destination === "number") {
this.endpointIndex = this.destination;
}
}

@@ -915,6 +920,6 @@ }

const destination = typeof this.destination === "number"
? // The destination is a single number
this.destination & 127
: // The destination is a bit mask
(0, safe_1.encodeBitMask)(this.destination, 7)[0] | 128;
// The destination is a single number
? this.destination & 127
// The destination is a bit mask
: (0, safe_1.encodeBitMask)(this.destination, 7)[0] | 128;
this.payload = Buffer.concat([

@@ -1015,3 +1020,4 @@ Buffer.from([this.endpointIndex & 127, destination]),

// This would be a NoOp CC, but it makes no sense to encapsulate that.
const isV2withV1Header = this.payload.length >= 2 && this.payload[1] === 0x00;
const isV2withV1Header = this.payload.length >= 2
&& this.payload[1] === 0x00;
// No need to validate further, each CC does it for itself

@@ -1018,0 +1024,0 @@ this.encapsulated = CommandClass_1.CommandClass.from(this.host, {

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { MultiCommandCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare class MultiCommandCCAPI extends CCAPI {

@@ -66,4 +66,4 @@ "use strict";

static requiresEncapsulation(cc) {
return (cc.endpointIndex !== 0 &&
!(cc instanceof MultiCommandCCCommandEncapsulation));
return (cc.endpointIndex !== 0
&& !(cc instanceof MultiCommandCCCommandEncapsulation));
}

@@ -70,0 +70,0 @@ static encapsulate(host, CCs) {

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { MultilevelSensorCommand, type MultilevelSensorValue } from "../lib/_Types";

@@ -10,0 +10,0 @@ export declare const MultilevelSensorCCValues: Readonly<{

@@ -70,11 +70,11 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Multilevel Sensor"], {
...Values_1.V.dynamicPropertyAndKeyWithName("supportedScales", "supportedScales", (sensorType) => sensorType, ({ property, propertyKey }) => property === "supportedScales" &&
typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyAndKeyWithName("supportedScales", "supportedScales", (sensorType) => sensorType, ({ property, propertyKey }) => property === "supportedScales"
&& typeof propertyKey === "number", undefined, { internal: true }),
...Values_1.V.dynamicPropertyWithName("value",
// This should have been the sensor type, but it is too late to change now
// Maybe we can migrate this without breaking in the future
(sensorTypeName) => sensorTypeName, ({ property, propertyKey }) => typeof property === "string" &&
property !== "supportedSensorTypes" &&
property !== "supportedScales" &&
propertyKey == undefined, (sensorTypeName) => ({
(sensorTypeName) => sensorTypeName, ({ property, propertyKey }) => typeof property === "string"
&& property !== "supportedSensorTypes"
&& property !== "supportedScales"
&& propertyKey == undefined, (sensorTypeName) => ({
// Just the base metadata, to be extended using a config manager

@@ -91,3 +91,4 @@ ...safe_1.ValueMetadata.ReadOnlyNumber,

function getPreferredSensorScale(applHost, nodeId, endpointIndex, sensorType, supportedScales) {
const scaleGroup = applHost.configManager.lookupSensorType(sensorType)?.scales;
const scaleGroup = applHost.configManager.lookupSensorType(sensorType)
?.scales;
// If the sensor type is unknown, we have no default. Use the user-provided scale or 0

@@ -189,3 +190,4 @@ if (!scaleGroup) {

};
const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific;
const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)
?.ccSpecific;
if (!ccSpecific) {

@@ -302,4 +304,4 @@ (0, API_1.throwUnsupportedProperty)(this.ccId, property);

if (sensorTypes) {
const logMessage = "received supported sensor types:\n" +
sensorTypes
const logMessage = "received supported sensor types:\n"
+ sensorTypes
.map((t) => applHost.configManager.getSensorTypeName(t))

@@ -331,4 +333,4 @@ .map((name) => `· ${name}`)

if (sensorScales) {
const logMessage = "received supported scales:\n" +
sensorScales
const logMessage = "received supported scales:\n"
+ sensorScales
.map((s) => applHost.configManager.lookupSensorScale(type, s).label)

@@ -418,4 +420,4 @@ .map((name) => `· ${name}`)

const lastUpdated = valueDB.getTimestamp(v);
return (lastUpdated == undefined ||
Date.now() - lastUpdated > core_1.timespan.hours(6));
return (lastUpdated == undefined
|| Date.now() - lastUpdated > core_1.timespan.hours(6));
});

@@ -470,6 +472,5 @@ }

this.value = options.value;
this.scale =
options.scale instanceof config_1.Scale
? options.scale.key
: options.scale;
this.scale = options.scale instanceof config_1.Scale
? options.scale.key
: options.scale;
}

@@ -546,4 +547,6 @@ }

if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
// TODO: Deserialize payload
throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
if (this.payload.length >= 2) {
this.sensorType = this.payload[0];
this.scale = (this.payload[1] >> 3) & 0b11;
}
}

@@ -558,5 +561,5 @@ else {

serialize() {
if (this.version >= 5 &&
this.sensorType != undefined &&
this.scale != undefined) {
if (this.version >= 5
&& this.sensorType != undefined
&& this.scale != undefined) {
this.payload = Buffer.from([

@@ -571,5 +574,5 @@ this.sensorType,

let message = {};
if (this.version >= 5 &&
this.sensorType != undefined &&
this.scale != undefined) {
if (this.version >= 5
&& this.sensorType != undefined
&& this.scale != undefined) {
message = {

@@ -576,0 +579,0 @@ "sensor type": applHost.configManager.getSensorTypeName(this.sensorType),

/// <reference types="node" />
import { CommandClasses, Duration, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, type PollValueImplementation, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { LevelChangeDirection, MultilevelSwitchCommand, SwitchType } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const MultilevelSwitchCCValues: Readonly<{

@@ -243,4 +243,4 @@ "use strict";

return up;
}, ({ property }) => typeof property === "string" &&
switchTypeProperties.indexOf(property) % 2 === 1, (switchType) => {
}, ({ property }) => typeof property === "string"
&& switchTypeProperties.indexOf(property) % 2 === 1, (switchType) => {
const switchTypeName = (0, safe_2.getEnumMemberName)(_Types_1.SwitchType, switchType);

@@ -266,4 +266,4 @@ const [, up] = switchTypeToActions(switchTypeName);

return down;
}, ({ property }) => typeof property === "string" &&
switchTypeProperties.indexOf(property) % 2 === 0, (switchType) => {
}, ({ property }) => typeof property === "string"
&& switchTypeProperties.indexOf(property) % 2 === 0, (switchType) => {
const switchTypeName = (0, safe_2.getEnumMemberName)(_Types_1.SwitchType, switchType);

@@ -295,3 +295,4 @@ const [down] = switchTypeToActions(switchTypeName);

const duration = safe_1.Duration.from(options?.transitionDuration);
const currentValueValueId = exports.MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index);
const currentValueValueId = exports.MultilevelSwitchCCValues.currentValue
.endpoint(this.endpoint.index);
return {

@@ -304,5 +305,5 @@ // Multilevel Switch commands may take some time to be executed.

// Only update currentValue for valid target values
if (typeof value === "number" &&
value >= 0 &&
value <= 99) {
if (typeof value === "number"
&& value >= 0
&& value <= 99) {
this.tryGetValueDB()?.setValue(currentValueValueId, value);

@@ -331,5 +332,5 @@ }

// Only update currentValue for valid target values
if (typeof value === "number" &&
value >= 0 &&
value <= 99) {
if (typeof value === "number"
&& value >= 0
&& value <= 99) {
if (this.isSinglecast()) {

@@ -340,3 +341,4 @@ this.tryGetValueDB()?.setValue(currentValueValueId, value);

// Figure out which nodes were affected by this command
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
const affectedNodes = this.endpoint.node
.physicalNodes.filter((node) => node
.getEndpoint(this.endpoint.index)

@@ -358,6 +360,6 @@ ?.supportsCC(this.ccId));

verifyChanges: () => {
if (this.isSinglecast() ||
if (this.isSinglecast()
// We generally don't want to poll for multicasts because of how much traffic it can cause
// However, when setting the value 255 (ON), we don't know the actual state
(this.isMulticast() && value === 255)) {
|| (this.isMulticast() && value === 255)) {
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll

@@ -465,4 +467,4 @@ this.schedulePoll(currentValueValueId, value === 255 ? undefined : value, { duration });

// at odd indices and negative motions at even indices
const direction = switchTypeProperties.indexOf(property) % 2 ===
0
const direction = switchTypeProperties.indexOf(property) % 2
=== 0
? "down"

@@ -706,4 +708,4 @@ : "up";

serialize() {
const controlByte = (_Types_1.LevelChangeDirection[this.direction] << 6) |
(this.ignoreStartLevel ? 32 : 0);
const controlByte = (_Types_1.LevelChangeDirection[this.direction] << 6)
| (this.ignoreStartLevel ? 32 : 0);
const payload = [controlByte, this.startLevel];

@@ -710,0 +712,0 @@ if (this.version >= 2) {

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, PhysicalCCAPI, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { NodeNamingAndLocationCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const NodeNamingAndLocationCCValues: Readonly<{

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { NotificationCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const NotificationCCValues: Readonly<{

@@ -219,4 +219,4 @@ "use strict";

...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses.Notification, {
...Values_1.V.dynamicPropertyAndKeyWithName("supportedNotificationEvents", "supportedNotificationEvents", (notificationType) => notificationType, ({ property, propertyKey }) => property === "supportedNotificationEvents" &&
typeof propertyKey === "number", undefined, { internal: true, supportsEndpoints: false }),
...Values_1.V.dynamicPropertyAndKeyWithName("supportedNotificationEvents", "supportedNotificationEvents", (notificationType) => notificationType, ({ property, propertyKey }) => property === "supportedNotificationEvents"
&& typeof propertyKey === "number", undefined, { internal: true, supportsEndpoints: false }),
// Different variants of the V2 notification values:

@@ -254,4 +254,4 @@ // Unknown type

// Window/door is open
0x16) &&
supportedACEvents.includes(
0x16)
&& supportedACEvents.includes(
// Window/door is closed

@@ -291,3 +291,4 @@ 0x17));

if (exports.NotificationCCValues.notificationVariable.is(valueId)) {
const notificationType = this.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific
const notificationType = this
.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific
?.notificationType;

@@ -388,4 +389,5 @@ if (notificationType != undefined) {

// which also has an enum parameter
if (numStatesWithEnums === 1 && variable.states.size === 1)
if (numStatesWithEnums === 1 && variable.states.size === 1) {
return "replace";
}
return "extend";

@@ -444,3 +446,4 @@ }

try {
const groupsIssueingNotifications = AssociationGroupInfoCC_1.AssociationGroupInfoCC.findGroupsForIssuedCommand(applHost, node, this.ccId, _Types_1.NotificationCommand.Report);
const groupsIssueingNotifications = AssociationGroupInfoCC_1.AssociationGroupInfoCC
.findGroupsForIssuedCommand(applHost, node, this.ccId, _Types_1.NotificationCommand.Report);
return groupsIssueingNotifications.length > 0 ? "push" : "pull";

@@ -579,3 +582,4 @@ }

const name = supportedNotificationNames[i];
const notificationConfig = applHost.configManager.lookupNotification(type);
const notificationConfig = applHost.configManager
.lookupNotification(type);
// Enable reports for each notification type

@@ -593,5 +597,7 @@ applHost.controllerLog.logNode(node.id, {

// Find all variables that are supported by this node and have an idle state
for (const variable of notificationConfig.variables.filter((v) => !!v.idle)) {
for (const variable of notificationConfig.variables
.filter((v) => !!v.idle)) {
if ([...variable.states.keys()].some((key) => events.includes(key))) {
const value = exports.NotificationCCValues.notificationVariable(notificationConfig.name, variable.name);
const value = exports.NotificationCCValues
.notificationVariable(notificationConfig.name, variable.name);
// Set the value to idle if it has no value yet

@@ -601,5 +607,5 @@ // TODO: GH#1028

// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start
if (this.getValue(applHost, value) ==
undefined) {
this.setValue(applHost, value, 0 /* idle */);
if (this.getValue(applHost, value)
== undefined) {
this.setValue(applHost, value, 0);
}

@@ -624,3 +630,4 @@ }

for (const { to } of mappings) {
const notificationConfig = applHost.configManager.lookupNotification(to.notificationType);
const notificationConfig = applHost.configManager
.lookupNotification(to.notificationType);
if (!notificationConfig)

@@ -631,3 +638,4 @@ continue;

continue;
const notificationValue = exports.NotificationCCValues.notificationVariable(notificationConfig.name, valueConfig.variableName);
const notificationValue = exports.NotificationCCValues
.notificationVariable(notificationConfig.name, valueConfig.variableName);
// Create or update the metadata

@@ -642,3 +650,3 @@ const metadata = getNotificationValueMetadata(this.getMetadata(applHost, notificationValue), notificationConfig, valueConfig);

if (this.getValue(applHost, notificationValue) == undefined) {
this.setValue(applHost, notificationValue, 0 /* idle */);
this.setValue(applHost, notificationValue, 0);
}

@@ -691,4 +699,4 @@ }

const lastUpdated = this.getValue(applHost, exports.NotificationCCValues.lastRefresh);
return (lastUpdated == undefined ||
Date.now() - lastUpdated > core_1.timespan.hours(6));
return (lastUpdated == undefined
|| Date.now() - lastUpdated > core_1.timespan.hours(6));
}

@@ -743,4 +751,4 @@ };

// V2..V3, reserved in V4+
if ((this.version === 2 || this.version === 3) &&
this.payload.length >= 3) {
if ((this.version === 2 || this.version === 3)
&& this.payload.length >= 3) {
this.zensorNetSourceNodeId = this.payload[2];

@@ -789,5 +797,5 @@ }

// Check if we need to re-interpret the alarm values somehow
if (this.alarmType != undefined &&
this.alarmLevel != undefined &&
this.alarmType !== 0) {
if (this.alarmType != undefined
&& this.alarmLevel != undefined
&& this.alarmType !== 0) {
if (this.version >= 2) {

@@ -797,7 +805,7 @@ // Check if the device actually supports Notification CC, but chooses

const supportedNotificationTypes = this.getValue(applHost, exports.NotificationCCValues.supportedNotificationTypes);
if ((0, typeguards_1.isArray)(supportedNotificationTypes) &&
supportedNotificationTypes.includes(this.alarmType)) {
if ((0, typeguards_1.isArray)(supportedNotificationTypes)
&& supportedNotificationTypes.includes(this.alarmType)) {
const supportedNotificationEvents = this.getValue(applHost, exports.NotificationCCValues.supportedNotificationEvents(this.alarmType));
if ((0, typeguards_1.isArray)(supportedNotificationEvents) &&
supportedNotificationEvents.includes(this.alarmLevel)) {
if ((0, typeguards_1.isArray)(supportedNotificationEvents)
&& supportedNotificationEvents.includes(this.alarmLevel)) {
// This alarm frame corresponds to a valid notification event

@@ -815,5 +823,5 @@ applHost.controllerLog.logNode(this.nodeId, `treating V1 Alarm frame as Notification Report`);

const mapping = this.host.getDeviceConfig?.(this.nodeId)?.compat?.alarmMapping;
const match = mapping?.find((m) => m.from.alarmType === this.alarmType &&
(m.from.alarmLevel == undefined ||
m.from.alarmLevel === this.alarmLevel));
const match = mapping?.find((m) => m.from.alarmType === this.alarmType
&& (m.from.alarmLevel == undefined
|| m.from.alarmLevel === this.alarmLevel));
if (match) {

@@ -874,6 +882,7 @@ applHost.controllerLog.logNode(this.nodeId, `compat mapping found, treating V1 Alarm frame as Notification Report`);

...message,
"notification type": applHost.configManager.getNotificationName(this.notificationType),
"notification type": applHost.configManager
.getNotificationName(this.notificationType),
"notification status": this.notificationStatus,
[`notification ${valueConfig.type}`]: valueConfig.label ??
`Unknown (${(0, safe_2.num2hex)(this.notificationEvent)})`,
[`notification ${valueConfig.type}`]: valueConfig.label
?? `Unknown (${(0, safe_2.num2hex)(this.notificationEvent)})`,
};

@@ -908,4 +917,4 @@ }

let found = false;
if (valueConfig?.parameter instanceof
config_1.NotificationParameterWithEnum) {
if (valueConfig?.parameter
instanceof config_1.NotificationParameterWithEnum) {
const label = valueConfig.parameter.values.get(this.eventParameters);

@@ -940,5 +949,5 @@ if (label) {

// This only makes sense for V2+ notifications with a non-empty event parameters buffer
if (this.notificationType == undefined ||
this.notificationEvent == undefined ||
!Buffer.isBuffer(this.eventParameters)) {
if (this.notificationType == undefined
|| this.notificationEvent == undefined
|| !Buffer.isBuffer(this.eventParameters)) {
return;

@@ -958,9 +967,9 @@ }

}
else if (valueConfig.parameter instanceof
config_1.NotificationParameterWithCommandClass) {
else if (valueConfig.parameter
instanceof config_1.NotificationParameterWithCommandClass) {
// The parameters **should** contain a CC, however there might be some exceptions
if (this.eventParameters.length === 1 &&
notificationConfig.id === 0x06 &&
(this.notificationEvent === 0x05 ||
this.notificationEvent === 0x06)) {
if (this.eventParameters.length === 1
&& notificationConfig.id === 0x06
&& (this.notificationEvent === 0x05
|| this.notificationEvent === 0x06)) {
// Access control -> Keypad Lock/Unlock operation

@@ -983,4 +992,4 @@ // Some devices only send the User ID, not a complete CC payload

if ((0, NotificationEventPayload_1.isNotificationEventPayload)(cc)) {
this.eventParameters =
cc.toNotificationEventParameters();
this.eventParameters = cc
.toNotificationEventParameters();
}

@@ -990,5 +999,5 @@ else {

let json = cc.toJSON();
if ("nodeId" in json &&
"ccId" in json &&
"payload" in json) {
if ("nodeId" in json
&& "ccId" in json
&& "payload" in json) {
json = (0, safe_2.pick)(json, ["payload"]);

@@ -1000,11 +1009,11 @@ }

catch (e) {
if ((0, safe_1.isZWaveError)(e) &&
e.code ===
safe_1.ZWaveErrorCodes.PacketFormat_InvalidPayload &&
Buffer.isBuffer(this.eventParameters)) {
if ((0, safe_1.isZWaveError)(e)
&& e.code
=== safe_1.ZWaveErrorCodes.PacketFormat_InvalidPayload
&& Buffer.isBuffer(this.eventParameters)) {
const ccId = CommandClass_1.CommandClass.getCommandClass(this.eventParameters);
const ccCommand = CommandClass_1.CommandClass.getCCCommand(this.eventParameters);
if (ccId === safe_1.CommandClasses["User Code"] &&
ccCommand === _Types_1.UserCodeCommand.Report &&
this.eventParameters.length >= 3) {
if (ccId === safe_1.CommandClasses["User Code"]
&& ccCommand === _Types_1.UserCodeCommand.Report
&& this.eventParameters.length >= 3) {
// Access control -> Keypad Lock/Unlock operation

@@ -1030,3 +1039,4 @@ // Some devices report the user code with truncated UserCode reports

this.eventParameters = {
[valueConfig.parameter.propertyName]: this.eventParameters.readUIntBE(0, this.eventParameters.length),
[valueConfig.parameter.propertyName]: this.eventParameters
.readUIntBE(0, this.eventParameters.length),
};

@@ -1036,6 +1046,5 @@ }

// The parameters may contain an enum value
this.eventParameters =
this.eventParameters.length === 1
? this.eventParameters[0]
: undefined;
this.eventParameters = this.eventParameters.length === 1
? this.eventParameters[0]
: undefined;
}

@@ -1051,12 +1060,12 @@ }

else {
if (this.notificationType == undefined ||
this.notificationEvent == undefined) {
if (this.notificationType == undefined
|| this.notificationEvent == undefined) {
throw new safe_1.ZWaveError(`Notification CC reports requires the notification type and event to be set!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
}
else if (this.eventParameters != undefined &&
!Buffer.isBuffer(this.eventParameters)) {
else if (this.eventParameters != undefined
&& !Buffer.isBuffer(this.eventParameters)) {
throw new safe_1.ZWaveError(`When sending Notification CC reports, the event parameters can only be buffers!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
}
const controlByte = (this.sequenceNumber != undefined ? 128 : 0) |
((this.eventParameters?.length ?? 0) & 0b11111);
const controlByte = (this.sequenceNumber != undefined ? 128 : 0)
| ((this.eventParameters?.length ?? 0) & 0b11111);
this.payload = Buffer.from([

@@ -1133,10 +1142,9 @@ 0,

if (this.notificationType != undefined) {
message["notification type"] =
applHost.configManager.getNotificationName(this.notificationType);
message["notification type"] = applHost.configManager
.getNotificationName(this.notificationType);
if (this.notificationEvent != undefined) {
message["notification event"] =
applHost.configManager
.lookupNotification(this.notificationType)
?.events.get(this.notificationEvent)?.label ??
`Unknown (${(0, safe_2.num2hex)(this.notificationEvent)})`;
message["notification event"] = applHost.configManager
.lookupNotification(this.notificationType)
?.events.get(this.notificationEvent)?.label
?? `Unknown (${(0, safe_2.num2hex)(this.notificationEvent)})`;
}

@@ -1251,3 +1259,4 @@ }

if (valueConfig?.type === "state") {
const notificationValue = exports.NotificationCCValues.notificationVariable(notificationConfig.name, valueConfig.variableName);
const notificationValue = exports.NotificationCCValues
.notificationVariable(notificationConfig.name, valueConfig.variableName);
// After we've created the metadata initially, extend it

@@ -1280,4 +1289,4 @@ const metadata = getNotificationValueMetadata(isFirst

"supported events": this.supportedEvents
.map((e) => `\n· ${notification?.lookupValue(e)?.label ??
`Unknown (${(0, safe_2.num2hex)(e)})`}`)
.map((e) => `\n· ${notification?.lookupValue(e)?.label
?? `Unknown (${(0, safe_2.num2hex)(e)})`}`)
.join(""),

@@ -1284,0 +1293,0 @@ },

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { Powerlevel, PowerlevelCommand, PowerlevelTestStatus } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare class PowerlevelCCAPI extends PhysicalCCAPI {

/// <reference types="node" />
import { CommandClasses, Timeout, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, Timeout } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { LocalProtectionState, ProtectionCommand, RFProtectionState } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const ProtectionCCValues: Readonly<{

@@ -103,9 +103,9 @@ "use strict";

case _Types_1.ProtectionCommand.TimeoutSet: {
return (this.isSinglecast() &&
this.tryGetValueDB()?.getValue(exports.ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));
return (this.isSinglecast()
&& this.tryGetValueDB()?.getValue(exports.ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));
}
case _Types_1.ProtectionCommand.ExclusiveControlGet:
case _Types_1.ProtectionCommand.ExclusiveControlSet: {
return (this.isSinglecast() &&
this.tryGetValueDB()?.getValue(exports.ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
return (this.isSinglecast()
&& this.tryGetValueDB()?.getValue(exports.ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
}

@@ -112,0 +112,0 @@ }

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SceneActivationCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const SceneActivationCCValues: Readonly<{

/// <reference types="node" />
import { CommandClasses, Duration, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SceneActuatorConfigurationCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const SceneActuatorConfigurationCCValues: Readonly<{

@@ -76,4 +76,4 @@ "use strict";

})),
...Values_1.V.dynamicPropertyAndKeyWithName("dimmingDuration", "dimmingDuration", (sceneId) => sceneId, ({ property, propertyKey }) => property === "dimmingDuration" &&
typeof propertyKey === "number", (sceneId) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("dimmingDuration", "dimmingDuration", (sceneId) => sceneId, ({ property, propertyKey }) => property === "dimmingDuration"
&& typeof propertyKey === "number", (sceneId) => ({
...safe_1.ValueMetadata.Duration,

@@ -111,4 +111,4 @@ label: `Dimming duration (${sceneId})`,

// 3. default
const dimmingDuration = safe_1.Duration.from(options?.transitionDuration) ??
this.tryGetValueDB()?.getValue(exports.SceneActuatorConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index));
const dimmingDuration = safe_1.Duration.from(options?.transitionDuration)
?? this.tryGetValueDB()?.getValue(exports.SceneActuatorConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index));
return this.set(propertyKey, dimmingDuration, value);

@@ -165,3 +165,4 @@ }

sceneId,
dimmingDuration: safe_1.Duration.from(dimmingDuration) ?? new safe_1.Duration(0, "seconds"),
dimmingDuration: safe_1.Duration.from(dimmingDuration)
?? new safe_1.Duration(0, "seconds"),
level,

@@ -215,3 +216,4 @@ });

this.ensureMetadata(applHost, levelValue);
const dimmingDurationValue = exports.SceneActuatorConfigurationCCValues.dimmingDuration(sceneId);
const dimmingDurationValue = exports.SceneActuatorConfigurationCCValues
.dimmingDuration(sceneId);
this.ensureMetadata(applHost, dimmingDurationValue);

@@ -277,4 +279,4 @@ }

this.level = this.payload[1];
this.dimmingDuration =
safe_1.Duration.parseReport(this.payload[2]) ?? safe_1.Duration.unknown();
this.dimmingDuration = safe_1.Duration.parseReport(this.payload[2])
?? safe_1.Duration.unknown();
}

@@ -286,5 +288,5 @@ }

// Do not persist values for an inactive scene
if (this.sceneId === 0 ||
this.level == undefined ||
this.dimmingDuration == undefined) {
if (this.sceneId === 0
|| this.level == undefined
|| this.dimmingDuration == undefined) {
return false;

@@ -294,3 +296,4 @@ }

this.ensureMetadata(applHost, levelValue);
const dimmingDurationValue = exports.SceneActuatorConfigurationCCValues.dimmingDuration(this.sceneId);
const dimmingDurationValue = exports.SceneActuatorConfigurationCCValues
.dimmingDuration(this.sceneId);
this.ensureMetadata(applHost, dimmingDurationValue);

@@ -297,0 +300,0 @@ this.setValue(applHost, levelValue, this.level);

/// <reference types="node" />
import { CommandClasses, Duration, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SceneControllerConfigurationCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const SceneControllerConfigurationCCValues: Readonly<{

@@ -64,4 +64,4 @@ "use strict";

})),
...Values_1.V.dynamicPropertyAndKeyWithName("dimmingDuration", "dimmingDuration", (groupId) => groupId, ({ property, propertyKey }) => property === "dimmingDuration" &&
typeof propertyKey === "number", (groupId) => ({
...Values_1.V.dynamicPropertyAndKeyWithName("dimmingDuration", "dimmingDuration", (groupId) => groupId, ({ property, propertyKey }) => property === "dimmingDuration"
&& typeof propertyKey === "number", (groupId) => ({
...safe_1.ValueMetadata.Duration,

@@ -104,5 +104,6 @@ label: `Dimming duration (${groupId})`,

// 3. default value
const dimmingDuration = safe_1.Duration.from(options?.transitionDuration) ??
this.tryGetValueDB()?.getValue(exports.SceneControllerConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index)) ??
safe_1.Duration.default();
const dimmingDuration = safe_1.Duration.from(options?.transitionDuration)
?? this.tryGetValueDB()?.getValue(exports.SceneControllerConfigurationCCValues
.dimmingDuration(propertyKey).endpoint(this.endpoint.index))
?? safe_1.Duration.default();
return this.set(propertyKey, value, dimmingDuration);

@@ -125,3 +126,4 @@ }

// So we save it in the valueDB without sending it to the node
const dimmingDurationValueId = exports.SceneControllerConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index);
const dimmingDurationValueId = exports.SceneControllerConfigurationCCValues
.dimmingDuration(propertyKey).endpoint(this.endpoint.index);
valueDB.setValue(dimmingDurationValueId, dimmingDuration);

@@ -167,3 +169,4 @@ }

if (!this.endpoint.virtual) {
const groupCount = SceneControllerConfigurationCC.getGroupCountCached(this.applHost, this.endpoint);
const groupCount = SceneControllerConfigurationCC
.getGroupCountCached(this.applHost, this.endpoint);
// The client SHOULD NOT specify group 1 (the life-line group).

@@ -262,3 +265,4 @@ // We don't block it here, because the specs don't forbid it,

this.ensureMetadata(applHost, sceneIdValue);
const dimmingDurationValue = exports.SceneControllerConfigurationCCValues.dimmingDuration(groupId);
const dimmingDurationValue = exports.SceneControllerConfigurationCCValues
.dimmingDuration(groupId);
this.ensureMetadata(applHost, dimmingDurationValue);

@@ -306,5 +310,5 @@ }

return (applHost.getDeviceConfig?.(endpoint.nodeId)?.compat
?.forceSceneControllerGroupCount ??
AssociationCC_1.AssociationCC.getGroupCountCached(applHost, endpoint) ??
0);
?.forceSceneControllerGroupCount
?? AssociationCC_1.AssociationCC.getGroupCountCached(applHost, endpoint)
?? 0);
}

@@ -328,4 +332,4 @@ };

// if dimmingDuration was missing, use default duration.
this.dimmingDuration =
safe_1.Duration.from(options.dimmingDuration) ?? safe_1.Duration.default();
this.dimmingDuration = safe_1.Duration.from(options.dimmingDuration)
?? safe_1.Duration.default();
}

@@ -362,4 +366,4 @@ }

this.sceneId = this.payload[1];
this.dimmingDuration =
safe_1.Duration.parseReport(this.payload[2]) ?? safe_1.Duration.unknown();
this.dimmingDuration = safe_1.Duration.parseReport(this.payload[2])
?? safe_1.Duration.unknown();
}

@@ -374,3 +378,4 @@ persistValues(applHost) {

this.ensureMetadata(applHost, sceneIdValue);
const dimmingDurationValue = exports.SceneControllerConfigurationCCValues.dimmingDuration(this.groupId);
const dimmingDurationValue = exports.SceneControllerConfigurationCCValues
.dimmingDuration(this.groupId);
this.ensureMetadata(applHost, dimmingDurationValue);

@@ -377,0 +382,0 @@ this.setValue(applHost, sceneIdValue, this.sceneId);

@@ -7,4 +7,4 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ScheduleEntryLockCommand, ScheduleEntryLockScheduleKind, ScheduleEntryLockSetAction, ScheduleEntryLockWeekday, type ScheduleEntryLockDailyRepeatingSchedule, type ScheduleEntryLockSlotId, type ScheduleEntryLockWeekDaySchedule, type ScheduleEntryLockYearDaySchedule, type Timezone } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ScheduleEntryLockCommand, type ScheduleEntryLockDailyRepeatingSchedule, ScheduleEntryLockScheduleKind, ScheduleEntryLockSetAction, type ScheduleEntryLockSlotId, type ScheduleEntryLockWeekDaySchedule, ScheduleEntryLockWeekday, type ScheduleEntryLockYearDaySchedule, type Timezone } from "../lib/_Types";
export declare const ScheduleEntryLockCCValues: Readonly<{

@@ -11,0 +11,0 @@ schedule: ((scheduleKind: ScheduleEntryLockScheduleKind, userId: number, slotId: number) => {

/// <reference types="node" />
import { CommandClasses, SecurityClass, type MessageOrCCLogEntry, type S2SecurityClass, type SecurityManager2 } from "@zwave-js/core";
import { CommandClasses, type MessageOrCCLogEntry, type S2SecurityClass, SecurityClass, type SecurityManager2 } from "@zwave-js/core";
import { type MaybeNotKnown } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { Security2Extension } from "../lib/Security2/Extension";

@@ -8,0 +8,0 @@ import { ECDHProfiles, KEXFailType, KEXSchemes } from "../lib/Security2/shared";

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SecurityCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare class SecurityCCAPI extends PhysicalCCAPI {

@@ -110,3 +110,4 @@ "use strict";

// Seems we need these options or some nodes won't accept the nonce
transmitOptions: core_1.TransmitOptions.ACK | core_1.TransmitOptions.AutoRoute,
transmitOptions: core_1.TransmitOptions.ACK
| core_1.TransmitOptions.AutoRoute,
// Only try sending a nonce once

@@ -278,5 +279,5 @@ maxSendAttempts: 1,

// S2, CRC16, Transport Service -> no S2 encapsulation
if (cc instanceof Security2CC_1.Security2CC ||
cc instanceof CRC16CC_1.CRC16CC ||
cc instanceof TransportServiceCC_1.TransportServiceCC) {
if (cc instanceof Security2CC_1.Security2CC
|| cc instanceof CRC16CC_1.CRC16CC
|| cc instanceof TransportServiceCC_1.TransportServiceCC) {
return false;

@@ -313,4 +314,4 @@ }

// but omit Security, since we're doing that right now
ret.encapsulationFlags =
cc.encapsulationFlags & ~core_1.EncapsulationFlags.Security;
ret.encapsulationFlags = cc.encapsulationFlags
& ~core_1.EncapsulationFlags.Security;
return ret;

@@ -451,4 +452,5 @@ }

throwNoNonce();
if (this.nonce.length !== HALF_NONCE_SIZE)
if (this.nonce.length !== HALF_NONCE_SIZE) {
throwNoNonce("Invalid nonce size");
}
const serializedCC = this.encapsulated.serialize();

@@ -455,0 +457,0 @@ const plaintext = Buffer.concat([

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SoundSwitchCommand, type ToneId } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const SoundSwitchCCValues: Readonly<{

@@ -178,3 +178,3 @@ "use strict";

}
return this.setConfiguration(value, 0xff /* keep current volume */);
return this.setConfiguration(value, 0xff);
}

@@ -185,3 +185,3 @@ else if (property === "defaultVolume") {

}
return this.setConfiguration(0x00 /* keep current tone */, value);
return this.setConfiguration(0x00, /* keep current tone */ value);
}

@@ -203,4 +203,4 @@ else if (property === "toneId") {

}
if (this.isSinglecast() &&
!(0, safe_1.supervisedCommandSucceeded)(result)) {
if (this.isSinglecast()
&& !(0, safe_1.supervisedCommandSucceeded)(result)) {
// Verify the current value after a (short) delay, unless the command was supervised and successful

@@ -207,0 +207,0 @@ this.schedulePoll({ property }, value, {

/// <reference types="node" />
import { CommandClasses, Duration, EncapsulationFlags, SupervisionStatus, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SinglecastCC, type SupervisionResult } from "@zwave-js/core/safe";
import { CommandClasses, Duration, EncapsulationFlags, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SinglecastCC, type SupervisionResult, SupervisionStatus } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SupervisionCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const SupervisionCCValues: Readonly<{

@@ -21,4 +21,4 @@ "use strict";

// Used to remember whether a node supports supervision-encapsulation of the given CC
...Values_1.V.dynamicPropertyAndKeyWithName("ccSupported", "ccSupported", (ccId) => ccId, ({ property, propertyKey }) => property === "commandSupported" &&
typeof propertyKey === "number", undefined, { internal: true, supportsEndpoints: false }),
...Values_1.V.dynamicPropertyAndKeyWithName("ccSupported", "ccSupported", (ccId) => ccId, ({ property, propertyKey }) => property === "commandSupported"
&& typeof propertyKey === "number", undefined, { internal: true, supportsEndpoints: false }),
}),

@@ -82,5 +82,5 @@ });

static requiresEncapsulation(cc) {
return (!!(cc.encapsulationFlags & safe_1.EncapsulationFlags.Supervision) &&
!(cc instanceof SupervisionCCGet) &&
!(cc instanceof SupervisionCCReport));
return (!!(cc.encapsulationFlags & safe_1.EncapsulationFlags.Supervision)
&& !(cc instanceof SupervisionCCGet)
&& !(cc instanceof SupervisionCCReport));
}

@@ -101,4 +101,4 @@ /** Encapsulates a command that targets a specific endpoint */

// but omit Supervision, since we're doing that right now
ret.encapsulationFlags =
cc.encapsulationFlags & ~safe_1.EncapsulationFlags.Supervision;
ret.encapsulationFlags = cc.encapsulationFlags
& ~safe_1.EncapsulationFlags.Supervision;
return ret;

@@ -113,4 +113,4 @@ }

const supervisionEncapsulation = command.getEncapsulatingCC(safe_1.CommandClasses.Supervision, _Types_1.SupervisionCommand.Get);
if (supervisionEncapsulation.frameType !== "broadcast" &&
supervisionEncapsulation.frameType !== "multicast") {
if (supervisionEncapsulation.frameType !== "broadcast"
&& supervisionEncapsulation.frameType !== "multicast") {
return supervisionEncapsulation.sessionId;

@@ -155,7 +155,7 @@ }

// ... the node supports it
node.supportsCC(safe_1.CommandClasses.Supervision) &&
node.supportsCC(safe_1.CommandClasses.Supervision)
// ... the command is marked as "should use supervision"
(0, CommandClassDecorators_1.shouldUseSupervision)(command) &&
&& (0, CommandClassDecorators_1.shouldUseSupervision)(command)
// ... and we haven't previously determined that the node doesn't properly support it
SupervisionCC_1.getCCSupportedWithSupervision(applHost, endpoint, command.ccId));
&& SupervisionCC_1.getCCSupportedWithSupervision(applHost, endpoint, command.ccId));
}

@@ -194,5 +194,5 @@ };

Buffer.from([
(this.moreUpdatesFollow ? 128 : 0) |
(this.requestWakeUpOnDemand ? 64 : 0) |
(this.sessionId & 0b111111),
(this.moreUpdatesFollow ? 128 : 0)
| (this.requestWakeUpOnDemand ? 64 : 0)
| (this.sessionId & 0b111111),
this.status,

@@ -268,4 +268,4 @@ ]),

Buffer.from([
(this.requestStatusUpdates ? 128 : 0) |
(this.sessionId & 0b111111),
(this.requestStatusUpdates ? 128 : 0)
| (this.sessionId & 0b111111),
encapCC.length,

@@ -272,0 +272,0 @@ ]),

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ThermostatFanMode, ThermostatFanModeCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const ThermostatFanModeCCValues: Readonly<{

@@ -235,4 +235,4 @@ "use strict";

this.payload = Buffer.from([
(this.version >= 2 && this.off ? 128 : 0) |
(this.mode & 0b1111),
(this.version >= 2 && this.off ? 128 : 0)
| (this.mode & 0b1111),
]);

@@ -239,0 +239,0 @@ return super.serialize();

@@ -88,4 +88,4 @@ "use strict";

endpoint: this.endpointIndex,
message: "received current thermostat fan state: " +
(0, safe_2.getEnumMemberName)(_Types_1.ThermostatFanState, currentStatus),
message: "received current thermostat fan state: "
+ (0, safe_2.getEnumMemberName)(_Types_1.ThermostatFanState, currentStatus),
direction: "inbound",

@@ -92,0 +92,0 @@ });

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ThermostatMode, ThermostatModeCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const ThermostatModeCCValues: Readonly<{

@@ -126,4 +126,4 @@ "use strict";

// We accept the manufacturer data as a hex string. Make sure it's valid
if (manufacturerData.length % 2 !== 0 ||
!manufacturerData.match(/^[0-9a-f]+$/i)) {
if (manufacturerData.length % 2 !== 0
|| !manufacturerData.match(/^[0-9a-f]+$/i)) {
throw new safe_1.ZWaveError(`Manufacturer data must be represented as hexadecimal when passed as a string!`, safe_1.ZWaveErrorCodes.Argument_Invalid);

@@ -211,4 +211,4 @@ }

endpoint: this.endpointIndex,
message: "received current thermostat mode: " +
(0, safe_2.getEnumMemberName)(_Types_1.ThermostatMode, currentStatus.mode),
message: "received current thermostat mode: "
+ (0, safe_2.getEnumMemberName)(_Types_1.ThermostatMode, currentStatus.mode),
direction: "inbound",

@@ -238,10 +238,11 @@ });

this.mode = options.mode;
if ("manufacturerData" in options)
if ("manufacturerData" in options) {
this.manufacturerData = options.manufacturerData;
}
}
}
serialize() {
const manufacturerData = this.version >= 3 &&
this.mode === _Types_1.ThermostatMode["Manufacturer specific"] &&
this.manufacturerData
const manufacturerData = this.version >= 3
&& this.mode === _Types_1.ThermostatMode["Manufacturer specific"]
&& this.manufacturerData
? this.manufacturerData

@@ -302,5 +303,5 @@ : Buffer.from([]);

const supportedModes = this.getValue(applHost, supportedModesValue);
if (supportedModes &&
this.mode in _Types_1.ThermostatMode &&
!supportedModes.includes(this.mode)) {
if (supportedModes
&& this.mode in _Types_1.ThermostatMode
&& !supportedModes.includes(this.mode)) {
supportedModes.push(this.mode);

@@ -317,4 +318,4 @@ supportedModes.sort();

serialize() {
const manufacturerDataLength = this.mode === _Types_1.ThermostatMode["Manufacturer specific"] &&
this.manufacturerData
const manufacturerDataLength = this.mode === _Types_1.ThermostatMode["Manufacturer specific"]
&& this.manufacturerData
? Math.min(0b111, this.manufacturerData.length)

@@ -321,0 +322,0 @@ : 0;

@@ -6,4 +6,4 @@ /// <reference types="node" />

import { CCAPI, POLL_VALUE, type PollValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { SetbackType, ThermostatSetbackCommand, type SetbackState } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type SetbackState, SetbackType, ThermostatSetbackCommand } from "../lib/_Types";
export declare const ThermostatSetbackCCValues: Readonly<{

@@ -10,0 +10,0 @@ setbackState: {

@@ -201,4 +201,4 @@ "use strict";

// If we receive an unknown setback state, return the raw value
this.setbackState =
(0, serializers_1.decodeSetbackState)(this.payload[1]) || this.payload[1];
this.setbackState = (0, serializers_1.decodeSetbackState)(this.payload[1])
|| this.payload[1];
}

@@ -205,0 +205,0 @@ toLogEntry(applHost) {

@@ -5,4 +5,4 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ThermostatSetpointCommand, ThermostatSetpointType } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const ThermostatSetpointCCValues: Readonly<{

@@ -31,4 +31,16 @@ "use strict";

// to the actual enum values
// prettier-ignore
const thermostatSetpointTypeMap = [0x00, 0x01, 0x02, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f];
const thermostatSetpointTypeMap = [
0x00,
0x01,
0x02,
0x07,
0x08,
0x09,
0x0a,
0x0b,
0x0c,
0x0d,
0x0e,
0x0f,
];
const thermostatSetpointScaleName = "temperature";

@@ -262,3 +274,4 @@ function getScale(configManager, scale) {

supportedSetpointTypes.push(type);
logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
logMessage =
`received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
}

@@ -314,4 +327,4 @@ else if (!interpretation) {

setpointTypes = [...resp];
const logMessage = "received supported setpoint types:\n" +
setpointTypes
const logMessage = "received supported setpoint types:\n"
+ setpointTypes
.map((type) => (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type))

@@ -564,4 +577,4 @@ .map((name) => `· ${name}`)

max: this.maxValue,
unit: getSetpointUnit(applHost.configManager, this.minValueScale) ||
getSetpointUnit(applHost.configManager, this.maxValueScale),
unit: getSetpointUnit(applHost.configManager, this.minValueScale)
|| getSetpointUnit(applHost.configManager, this.maxValueScale),
});

@@ -568,0 +581,0 @@ return true;

@@ -6,3 +6,3 @@ /// <reference types="node" />

import { CCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { TimeCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare class TimeCCAPI extends CCAPI {

@@ -5,4 +5,4 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { TimeParametersCommand } from "../lib/_Types";

@@ -9,0 +9,0 @@ export declare const TimeParametersCCValues: Readonly<{

@@ -56,6 +56,8 @@ "use strict";

const ccVersion = endpoint.getCCVersion(core_1.CommandClasses.Time);
if (ccVersion >= 1 && endpoint.controlsCC(core_1.CommandClasses.Time))
if (ccVersion >= 1 && endpoint.controlsCC(core_1.CommandClasses.Time)) {
return false;
if (ccVersion >= 2 && endpoint.supportsCC(core_1.CommandClasses.Time))
}
if (ccVersion >= 2 && endpoint.supportsCC(core_1.CommandClasses.Time)) {
return false;
}
return true;

@@ -62,0 +64,0 @@ }

/// <reference types="node" />
import { CommandClasses, type MessageOrCCLogEntry, type SinglecastCC } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { TransportServiceCommand } from "../lib/_Types";

@@ -6,0 +6,0 @@ export declare const MAX_SEGMENT_SIZE = 39;

@@ -61,5 +61,5 @@ "use strict";

function isTransportServiceEncapsulation(command) {
return (command.ccId === safe_1.CommandClasses["Transport Service"] &&
(command.ccCommand === _Types_1.TransportServiceCommand.FirstSegment ||
command.ccCommand === _Types_1.TransportServiceCommand.SubsequentSegment));
return (command.ccId === safe_1.CommandClasses["Transport Service"]
&& (command.ccCommand === _Types_1.TransportServiceCommand.FirstSegment
|| command.ccCommand === _Types_1.TransportServiceCommand.SubsequentSegment));
}

@@ -108,5 +108,4 @@ exports.isTransportServiceEncapsulation = isTransportServiceEncapsulation;

// Transport Service re-uses the lower 3 bits of the ccCommand as payload
this.ccCommand =
(this.ccCommand & 248) |
((this.datagramSize >>> 8) & 0b111);
this.ccCommand = (this.ccCommand & 248)
| ((this.datagramSize >>> 8) & 0b111);
const ext = !!this.headerExtension && this.headerExtension.length >= 1;

@@ -147,5 +146,7 @@ this.payload = Buffer.from([

// Transport Service CC (first segment) adds 1 byte datagram size, 1 byte Session ID/..., 2 bytes checksum and (0 OR n+1) bytes header extension
return (super.computeEncapsulationOverhead() +
4 +
(this.headerExtension?.length ? 1 + this.headerExtension.length : 0));
return (super.computeEncapsulationOverhead()
+ 4
+ (this.headerExtension?.length
? 1 + this.headerExtension.length
: 0));
}

@@ -187,4 +188,4 @@ toLogEntry(applHost) {

this.sessionId = this.payload[2] >>> 4;
this.datagramOffset =
((this.payload[2] & 0b111) << 8) + this.payload[3];
this.datagramOffset = ((this.payload[2] & 0b111) << 8)
+ this.payload[3];
let payloadOffset = 4;

@@ -258,11 +259,10 @@ // If there is a header extension, read it

// Transport Service re-uses the lower 3 bits of the ccCommand as payload
this.ccCommand =
(this.ccCommand & 248) |
((this.datagramSize >>> 8) & 0b111);
this.ccCommand = (this.ccCommand & 248)
| ((this.datagramSize >>> 8) & 0b111);
const ext = !!this.headerExtension && this.headerExtension.length >= 1;
this.payload = Buffer.from([
this.datagramSize & 0xff,
((this.sessionId & 0b1111) << 4) |
(ext ? 0b1000 : 0) |
((this.datagramOffset >>> 8) & 0b111),
((this.sessionId & 0b1111) << 4)
| (ext ? 0b1000 : 0)
| ((this.datagramOffset >>> 8) & 0b111),
this.datagramOffset & 0xff,

@@ -293,5 +293,7 @@ ]);

// Transport Service CC (first segment) adds 1 byte datagram size, 1 byte Session ID/..., 1 byte offset, 2 bytes checksum and (0 OR n+1) bytes header extension
return (super.computeEncapsulationOverhead() +
5 +
(this.headerExtension?.length ? 1 + this.headerExtension.length : 0));
return (super.computeEncapsulationOverhead()
+ 5
+ (this.headerExtension?.length
? 1 + this.headerExtension.length
: 0));
}

@@ -315,9 +317,9 @@ toLogEntry(applHost) {

function testResponseForSegmentRequest(sent, received) {
return ((sent.datagramOffset === 0 &&
received instanceof TransportServiceCCFirstSegment &&
received.sessionId === sent.sessionId) ||
(sent.datagramOffset > 0 &&
received instanceof TransportServiceCCSubsequentSegment &&
sent.datagramOffset === received.datagramOffset &&
received.sessionId === sent.sessionId));
return ((sent.datagramOffset === 0
&& received instanceof TransportServiceCCFirstSegment
&& received.sessionId === sent.sessionId)
|| (sent.datagramOffset > 0
&& received instanceof TransportServiceCCSubsequentSegment
&& sent.datagramOffset === received.datagramOffset
&& received.sessionId === sent.sessionId));
}

@@ -330,4 +332,4 @@ let TransportServiceCCSegmentRequest = exports.TransportServiceCCSegmentRequest = class TransportServiceCCSegmentRequest extends TransportServiceCC {

this.sessionId = this.payload[1] >>> 4;
this.datagramOffset =
((this.payload[1] & 0b111) << 8) + this.payload[2];
this.datagramOffset = ((this.payload[1] & 0b111) << 8)
+ this.payload[2];
}

@@ -341,4 +343,4 @@ else {

this.payload = Buffer.from([
((this.sessionId & 0b1111) << 4) |
((this.datagramOffset >>> 8) & 0b111),
((this.sessionId & 0b1111) << 4)
| ((this.datagramOffset >>> 8) & 0b111),
this.datagramOffset & 0xff,

@@ -345,0 +347,0 @@ ]);

/// <reference types="node" />
import { CommandClasses, type IZWaveEndpoint, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { POLL_VALUE, PhysicalCCAPI, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import type { NotificationEventPayload } from "../lib/NotificationEventPayload";

@@ -7,0 +7,0 @@ import { KeypadMode, UserCodeCommand, UserIDStatus } from "../lib/_Types";

/// <reference types="node" />
import { CommandClasses, ZWaveLibraryTypes, type MaybeNotKnown, type MessageOrCCLogEntry } from "@zwave-js/core/safe";
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, ZWaveLibraryTypes } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { VersionCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const VersionCCValues: Readonly<{

@@ -376,3 +376,2 @@ "use strict";

if (versionGetResponse) {
// prettier-ignore
let logMessage = `received response for node versions:

@@ -383,3 +382,4 @@ library type: ${safe_1.ZWaveLibraryTypes[versionGetResponse.libraryType]} (${(0, safe_2.num2hex)(versionGetResponse.libraryType)})

if (versionGetResponse.hardwareVersion != undefined) {
logMessage += `\n hardware version: ${versionGetResponse.hardwareVersion}`;
logMessage +=
`\n hardware version: ${versionGetResponse.hardwareVersion}`;
}

@@ -386,0 +386,0 @@ applHost.controllerLog.logNode(node.id, {

/// <reference types="node" />
import { CommandClasses, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult } from "@zwave-js/core/safe";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host/safe";
import { CCAPI, POLL_VALUE, SET_VALUE, type PollValueImplementation, type SetValueImplementation } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { WakeUpCommand } from "../lib/_Types";

@@ -7,0 +7,0 @@ export declare const WakeUpCCValues: Readonly<{

@@ -5,5 +5,5 @@ /// <reference types="node" />

import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host";
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, type PollValueImplementation, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { WindowCoveringCommand, WindowCoveringParameter, type LevelChangeDirection } from "../lib/_Types";
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type LevelChangeDirection, WindowCoveringCommand, WindowCoveringParameter } from "../lib/_Types";
export declare const WindowCoveringCCValues: Readonly<{

@@ -10,0 +10,0 @@ levelChangeDown: ((parameter: WindowCoveringParameter) => {

@@ -200,4 +200,4 @@ "use strict";

// The direction refers to the change in level, not the physical location
"levelChangeDown", (parameter) => parameter, ({ property, propertyKey }) => property === "levelChangeDown" &&
typeof propertyKey === "number", (parameter) => {
"levelChangeDown", (parameter) => parameter, ({ property, propertyKey }) => property === "levelChangeDown"
&& typeof propertyKey === "number", (parameter) => {
return {

@@ -238,5 +238,5 @@ ...core_1.ValueMetadata.WriteOnlyBoolean,

// Only update currentValue for valid target values
if (typeof value === "number" &&
value >= 0 &&
value <= 99) {
if (typeof value === "number"
&& value >= 0
&& value <= 99) {
this.tryGetValueDB()?.setValue(currentValueValueId, value);

@@ -265,5 +265,5 @@ }

// Only update currentValue for valid target values
if (typeof value === "number" &&
value >= 0 &&
value <= 99) {
if (typeof value === "number"
&& value >= 0
&& value <= 99) {
if (this.isSinglecast()) {

@@ -274,3 +274,4 @@ this.tryGetValueDB()?.setValue(currentValueValueId, value);

// Figure out which nodes were affected by this command
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node
const affectedNodes = this.endpoint.node
.physicalNodes.filter((node) => node
.getEndpoint(this.endpoint.index)

@@ -321,5 +322,5 @@ ?.supportsCC(this.ccId));

if (exports.WindowCoveringCCValues.targetValue.is(valueId)) {
if (typeof propertyKey !== "number" ||
if (typeof propertyKey !== "number"
// Only odd-numbered parameters have position support and are writable
propertyKey % 2 === 0) {
|| propertyKey % 2 === 0) {
(0, API_1.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);

@@ -334,4 +335,4 @@ }

}
else if (exports.WindowCoveringCCValues.levelChangeUp.is(valueId) ||
exports.WindowCoveringCCValues.levelChangeDown.is(valueId)) {
else if (exports.WindowCoveringCCValues.levelChangeUp.is(valueId)
|| exports.WindowCoveringCCValues.levelChangeDown.is(valueId)) {
if (typeof value !== "boolean") {

@@ -554,4 +555,4 @@ (0, API_1.throwWrongValueType)(this.ccId, property, "boolean", typeof value);

this.targetValue = this.payload[2];
this.duration =
core_1.Duration.parseReport(this.payload[3]) ?? core_1.Duration.unknown();
this.duration = core_1.Duration.parseReport(this.payload[3])
?? core_1.Duration.unknown();
}

@@ -558,0 +559,0 @@ toLogEntry(applHost) {

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { PhysicalCCAPI } from "../lib/API";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { ZWavePlusCommand, ZWavePlusNodeType, ZWavePlusRoleType } from "../lib/_Types";

@@ -8,0 +8,0 @@ export declare const ZWavePlusCCValues: Readonly<{

/// <reference types="node" />
import { CommandClasses, ZWaveDataRate, type DataRate, type FLiRS, type NodeInformationFrame, type NodeProtocolInfoAndDeviceClass, type NodeType, type ProtocolVersion } from "@zwave-js/core";
import { CommandClasses, type DataRate, type FLiRS, type NodeInformationFrame, type NodeProtocolInfoAndDeviceClass, type NodeType, type ProtocolVersion, ZWaveDataRate } from "@zwave-js/core";
import type { ZWaveHost } from "@zwave-js/host";
import { CommandClass, type CCCommandOptions, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { WakeUpTime, ZWaveProtocolCommand, type NetworkTransferStatus } from "../lib/_Types";
import { type CCCommandOptions, CommandClass, type CommandClassDeserializationOptions } from "../lib/CommandClass";
import { type NetworkTransferStatus, WakeUpTime, ZWaveProtocolCommand } from "../lib/_Types";
export declare class ZWaveProtocolCC extends CommandClass {

@@ -7,0 +7,0 @@ ccCommand: ZWaveProtocolCommand;

@@ -232,5 +232,5 @@ "use strict";

this.payload = Buffer.from([
(this.supportsNWI ? 0b0001 : 0) |
(this.excludeNode ? 0b0010 : 0) |
(this.includeNode ? 0b0100 : 0),
(this.supportsNWI ? 0b0001 : 0)
| (this.excludeNode ? 0b0010 : 0)
| (this.includeNode ? 0b0100 : 0),
]);

@@ -609,4 +609,17 @@ return super.serialize();

this.powerDampening = [
0xf0, 0xc8, 0xa7, 0x91, 0x77, 0x67, 0x60, 0x46, 0x38, 0x35,
0x32, 0x30, 0x24, 0x22, 0x20,
0xf0,
0xc8,
0xa7,
0x91,
0x77,
0x67,
0x60,
0x46,
0x38,
0x35,
0x32,
0x30,
0x24,
0x22,
0x20,
].indexOf(this.payload[0]);

@@ -613,0 +626,0 @@ if (this.powerDampening === -1)

/// <reference types="node" />
import type { Scale } from "@zwave-js/config/safe";
import { ZWaveDataRate, type CommandClasses, type DataRate, type FLiRS, type MaybeNotKnown, type ValueMetadata } from "@zwave-js/core/safe";
import { type CommandClasses, type DataRate, type FLiRS, type MaybeNotKnown, type ValueMetadata, ZWaveDataRate } from "@zwave-js/core/safe";
export declare enum AlarmSensorCommand {

@@ -5,0 +5,0 @@ Get = 1,

@@ -1,2 +0,2 @@

import { CommandClasses, NODE_ID_BROADCAST, type Duration, type IVirtualEndpoint, type IZWaveEndpoint, type IZWaveNode, type MaybeNotKnown, type SendCommandOptions, type SupervisionResult, type TXReport, type ValueChangeOptions, type ValueDB, type ValueID } from "@zwave-js/core";
import { CommandClasses, type Duration, type IVirtualEndpoint, type IZWaveEndpoint, type IZWaveNode, type MaybeNotKnown, NODE_ID_BROADCAST, type SendCommandOptions, type SupervisionResult, type TXReport, type ValueChangeOptions, type ValueDB, type ValueID } from "@zwave-js/core";
import type { ZWaveApplicationHost } from "@zwave-js/host";

@@ -121,64 +121,64 @@ import { type AllOrNone, type OnlyMethods } from "@zwave-js/shared";

type CCNameMap = {
"Alarm Sensor": (typeof CommandClasses)["Alarm Sensor"];
Association: (typeof CommandClasses)["Association"];
"Association Group Information": (typeof CommandClasses)["Association Group Information"];
"Barrier Operator": (typeof CommandClasses)["Barrier Operator"];
Basic: (typeof CommandClasses)["Basic"];
Battery: (typeof CommandClasses)["Battery"];
"Binary Sensor": (typeof CommandClasses)["Binary Sensor"];
"Binary Switch": (typeof CommandClasses)["Binary Switch"];
"CRC-16 Encapsulation": (typeof CommandClasses)["CRC-16 Encapsulation"];
"Central Scene": (typeof CommandClasses)["Central Scene"];
"Climate Control Schedule": (typeof CommandClasses)["Climate Control Schedule"];
Clock: (typeof CommandClasses)["Clock"];
"Color Switch": (typeof CommandClasses)["Color Switch"];
Configuration: (typeof CommandClasses)["Configuration"];
"Device Reset Locally": (typeof CommandClasses)["Device Reset Locally"];
"Door Lock": (typeof CommandClasses)["Door Lock"];
"Door Lock Logging": (typeof CommandClasses)["Door Lock Logging"];
"Energy Production": (typeof CommandClasses)["Energy Production"];
"Entry Control": (typeof CommandClasses)["Entry Control"];
"Firmware Update Meta Data": (typeof CommandClasses)["Firmware Update Meta Data"];
"Humidity Control Mode": (typeof CommandClasses)["Humidity Control Mode"];
"Humidity Control Operating State": (typeof CommandClasses)["Humidity Control Operating State"];
"Humidity Control Setpoint": (typeof CommandClasses)["Humidity Control Setpoint"];
"Inclusion Controller": (typeof CommandClasses)["Inclusion Controller"];
Indicator: (typeof CommandClasses)["Indicator"];
Irrigation: (typeof CommandClasses)["Irrigation"];
Language: (typeof CommandClasses)["Language"];
Lock: (typeof CommandClasses)["Lock"];
"Manufacturer Proprietary": (typeof CommandClasses)["Manufacturer Proprietary"];
"Manufacturer Specific": (typeof CommandClasses)["Manufacturer Specific"];
Meter: (typeof CommandClasses)["Meter"];
"Multi Channel Association": (typeof CommandClasses)["Multi Channel Association"];
"Multi Channel": (typeof CommandClasses)["Multi Channel"];
"Multi Command": (typeof CommandClasses)["Multi Command"];
"Multilevel Sensor": (typeof CommandClasses)["Multilevel Sensor"];
"Multilevel Switch": (typeof CommandClasses)["Multilevel Switch"];
"No Operation": (typeof CommandClasses)["No Operation"];
"Node Naming and Location": (typeof CommandClasses)["Node Naming and Location"];
Notification: (typeof CommandClasses)["Notification"];
Powerlevel: (typeof CommandClasses)["Powerlevel"];
Protection: (typeof CommandClasses)["Protection"];
"Scene Activation": (typeof CommandClasses)["Scene Activation"];
"Scene Actuator Configuration": (typeof CommandClasses)["Scene Actuator Configuration"];
"Scene Controller Configuration": (typeof CommandClasses)["Scene Controller Configuration"];
"Schedule Entry Lock": (typeof CommandClasses)["Schedule Entry Lock"];
"Security 2": (typeof CommandClasses)["Security 2"];
Security: (typeof CommandClasses)["Security"];
"Sound Switch": (typeof CommandClasses)["Sound Switch"];
Supervision: (typeof CommandClasses)["Supervision"];
"Thermostat Fan Mode": (typeof CommandClasses)["Thermostat Fan Mode"];
"Thermostat Fan State": (typeof CommandClasses)["Thermostat Fan State"];
"Thermostat Mode": (typeof CommandClasses)["Thermostat Mode"];
"Thermostat Operating State": (typeof CommandClasses)["Thermostat Operating State"];
"Thermostat Setback": (typeof CommandClasses)["Thermostat Setback"];
"Thermostat Setpoint": (typeof CommandClasses)["Thermostat Setpoint"];
Time: (typeof CommandClasses)["Time"];
"Time Parameters": (typeof CommandClasses)["Time Parameters"];
"User Code": (typeof CommandClasses)["User Code"];
Version: (typeof CommandClasses)["Version"];
"Wake Up": (typeof CommandClasses)["Wake Up"];
"Window Covering": (typeof CommandClasses)["Window Covering"];
"Z-Wave Plus Info": (typeof CommandClasses)["Z-Wave Plus Info"];
"Alarm Sensor": typeof CommandClasses["Alarm Sensor"];
Association: typeof CommandClasses["Association"];
"Association Group Information": typeof CommandClasses["Association Group Information"];
"Barrier Operator": typeof CommandClasses["Barrier Operator"];
Basic: typeof CommandClasses["Basic"];
Battery: typeof CommandClasses["Battery"];
"Binary Sensor": typeof CommandClasses["Binary Sensor"];
"Binary Switch": typeof CommandClasses["Binary Switch"];
"CRC-16 Encapsulation": typeof CommandClasses["CRC-16 Encapsulation"];
"Central Scene": typeof CommandClasses["Central Scene"];
"Climate Control Schedule": typeof CommandClasses["Climate Control Schedule"];
Clock: typeof CommandClasses["Clock"];
"Color Switch": typeof CommandClasses["Color Switch"];
Configuration: typeof CommandClasses["Configuration"];
"Device Reset Locally": typeof CommandClasses["Device Reset Locally"];
"Door Lock": typeof CommandClasses["Door Lock"];
"Door Lock Logging": typeof CommandClasses["Door Lock Logging"];
"Energy Production": typeof CommandClasses["Energy Production"];
"Entry Control": typeof CommandClasses["Entry Control"];
"Firmware Update Meta Data": typeof CommandClasses["Firmware Update Meta Data"];
"Humidity Control Mode": typeof CommandClasses["Humidity Control Mode"];
"Humidity Control Operating State": typeof CommandClasses["Humidity Control Operating State"];
"Humidity Control Setpoint": typeof CommandClasses["Humidity Control Setpoint"];
"Inclusion Controller": typeof CommandClasses["Inclusion Controller"];
Indicator: typeof CommandClasses["Indicator"];
Irrigation: typeof CommandClasses["Irrigation"];
Language: typeof CommandClasses["Language"];
Lock: typeof CommandClasses["Lock"];
"Manufacturer Proprietary": typeof CommandClasses["Manufacturer Proprietary"];
"Manufacturer Specific": typeof CommandClasses["Manufacturer Specific"];
Meter: typeof CommandClasses["Meter"];
"Multi Channel Association": typeof CommandClasses["Multi Channel Association"];
"Multi Channel": typeof CommandClasses["Multi Channel"];
"Multi Command": typeof CommandClasses["Multi Command"];
"Multilevel Sensor": typeof CommandClasses["Multilevel Sensor"];
"Multilevel Switch": typeof CommandClasses["Multilevel Switch"];
"No Operation": typeof CommandClasses["No Operation"];
"Node Naming and Location": typeof CommandClasses["Node Naming and Location"];
Notification: typeof CommandClasses["Notification"];
Powerlevel: typeof CommandClasses["Powerlevel"];
Protection: typeof CommandClasses["Protection"];
"Scene Activation": typeof CommandClasses["Scene Activation"];
"Scene Actuator Configuration": typeof CommandClasses["Scene Actuator Configuration"];
"Scene Controller Configuration": typeof CommandClasses["Scene Controller Configuration"];
"Schedule Entry Lock": typeof CommandClasses["Schedule Entry Lock"];
"Security 2": typeof CommandClasses["Security 2"];
Security: typeof CommandClasses["Security"];
"Sound Switch": typeof CommandClasses["Sound Switch"];
Supervision: typeof CommandClasses["Supervision"];
"Thermostat Fan Mode": typeof CommandClasses["Thermostat Fan Mode"];
"Thermostat Fan State": typeof CommandClasses["Thermostat Fan State"];
"Thermostat Mode": typeof CommandClasses["Thermostat Mode"];
"Thermostat Operating State": typeof CommandClasses["Thermostat Operating State"];
"Thermostat Setback": typeof CommandClasses["Thermostat Setback"];
"Thermostat Setpoint": typeof CommandClasses["Thermostat Setpoint"];
Time: typeof CommandClasses["Time"];
"Time Parameters": typeof CommandClasses["Time Parameters"];
"User Code": typeof CommandClasses["User Code"];
Version: typeof CommandClasses["Version"];
"Wake Up": typeof CommandClasses["Wake Up"];
"Window Covering": typeof CommandClasses["Window Covering"];
"Z-Wave Plus Info": typeof CommandClasses["Z-Wave Plus Info"];
};

@@ -185,0 +185,0 @@ export type CCToName<CC extends CommandClasses> = {

@@ -55,12 +55,12 @@ "use strict";

// Forbid access to the API if it is not supported by the node
if (property !== "ccId" &&
property !== "endpoint" &&
property !== "isSupported" &&
property !== "withOptions" &&
property !== "commandOptions" &&
!target.isSupported()) {
if (property !== "ccId"
&& property !== "endpoint"
&& property !== "isSupported"
&& property !== "withOptions"
&& property !== "commandOptions"
&& !target.isSupported()) {
let messageStart;
if (endpoint.virtual) {
const hasNodeId = typeof endpoint.nodeId === "number" &&
endpoint.nodeId !== core_1.NODE_ID_BROADCAST;
const hasNodeId = typeof endpoint.nodeId === "number"
&& endpoint.nodeId !== core_1.NODE_ID_BROADCAST;
messageStart = `${hasNodeId ? "The" : "This"} virtual node${hasNodeId ? ` ${endpoint.nodeId}` : ""}`;

@@ -77,5 +77,5 @@ }

const fallback = target[property];
if (typeof property === "string" &&
!endpoint.virtual &&
typeof fallback === "function") {
if (typeof property === "string"
&& !endpoint.virtual
&& typeof fallback === "function") {
const overrides = applHost.getDeviceConfig?.(endpoint.nodeId)?.compat?.overrideQueries;

@@ -186,7 +186,7 @@ if (overrides?.hasOverride(ccId)) {

// NoOperation is always supported
this.ccId === core_1.CommandClasses["No Operation"] ||
this.ccId === core_1.CommandClasses["No Operation"]
// Basic should always be supported. Since we are trying to hide it from library consumers
// we cannot trust supportsCC to test it
this.ccId === core_1.CommandClasses.Basic ||
this.endpoint.supportsCC(this.ccId));
|| this.ccId === core_1.CommandClasses.Basic
|| this.endpoint.supportsCC(this.ccId));
}

@@ -264,4 +264,4 @@ /**

let original = target[prop];
if (proxiedProps.has(prop) &&
typeof original === "function") {
if (proxiedProps.has(prop)
&& typeof original === "function") {
// This is a method that only exists in the specific implementation

@@ -296,5 +296,5 @@ // Wrap each call with its own API proxy, so we don't mix up TX reports

isSinglecast() {
return (!this.endpoint.virtual &&
typeof this.endpoint.nodeId === "number" &&
this.endpoint.nodeId !== core_1.NODE_ID_BROADCAST);
return (!this.endpoint.virtual
&& typeof this.endpoint.nodeId === "number"
&& this.endpoint.nodeId !== core_1.NODE_ID_BROADCAST);
}

@@ -301,0 +301,0 @@ isMulticast() {

/// <reference types="node" />
import { CommandClasses, EncapsulationFlags, ZWaveErrorCodes, type BroadcastCC, type FrameType, type ICommandClass, type IZWaveEndpoint, type IZWaveNode, type MessageOrCCLogEntry, type MulticastCC, type MulticastDestination, type SinglecastCC, type ValueDB, type ValueID, type ValueMetadata } from "@zwave-js/core";
import { type BroadcastCC, CommandClasses, EncapsulationFlags, type FrameType, type ICommandClass, type IZWaveEndpoint, type IZWaveNode, type MessageOrCCLogEntry, type MulticastCC, type MulticastDestination, type SinglecastCC, type ValueDB, type ValueID, type ValueMetadata, ZWaveErrorCodes } from "@zwave-js/core";
import type { ZWaveApplicationHost, ZWaveHost } from "@zwave-js/host";

@@ -4,0 +4,0 @@ import { MessageOrigin } from "@zwave-js/serial";

@@ -31,6 +31,5 @@ "use strict";

// Extract the cc from declared metadata if not provided by the CC constructor
this.ccId =
"ccId" in options && options.ccId != undefined
? options.ccId
: (0, CommandClassDecorators_1.getCommandClass)(this);
this.ccId = "ccId" in options && options.ccId != undefined
? options.ccId
: (0, CommandClassDecorators_1.getCommandClass)(this);
// Default to the root endpoint - Inherited classes may override this behavior

@@ -43,9 +42,9 @@ this.endpointIndex =

// For deserialized commands, try to invoke the correct subclass constructor
const CCConstructor = (0, CommandClassDecorators_1.getCCConstructor)(CommandClass.getCommandClass(options.data)) ??
CommandClass;
const CCConstructor = (0, CommandClassDecorators_1.getCCConstructor)(CommandClass.getCommandClass(options.data))
?? CommandClass;
const ccCommand = CCConstructor.getCCCommand(options.data);
if (ccCommand != undefined) {
const CommandConstructor = (0, CommandClassDecorators_1.getCCCommandConstructor)(this.ccId, ccCommand);
if (CommandConstructor &&
new.target !== CommandConstructor) {
if (CommandConstructor
&& new.target !== CommandConstructor) {
return new CommandConstructor(host, options);

@@ -90,4 +89,4 @@ }

catch (e) {
if ((0, core_1.isZWaveError)(e) &&
e.code === core_1.ZWaveErrorCodes.CC_NotImplemented) {
if ((0, core_1.isZWaveError)(e)
&& e.code === core_1.ZWaveErrorCodes.CC_NotImplemented) {
// Someone tried to create a CC that is not implemented. Just set all versions to 0.

@@ -171,4 +170,5 @@ this.version = 0;

// NoOp CCs have no command and no payload
if (this.ccId === core_1.CommandClasses["No Operation"])
if (this.ccId === core_1.CommandClasses["No Operation"]) {
return Buffer.from([this.ccId]);
}
else if (this.ccCommand == undefined) {

@@ -227,4 +227,4 @@ throw new core_1.ZWaveError("Cannot serialize a Command Class without a command", core_1.ZWaveErrorCodes.CC_Invalid);

// Indicate invalid payloads with a special CC type
if ((0, core_1.isZWaveError)(e) &&
e.code === core_1.ZWaveErrorCodes.PacketFormat_InvalidPayload) {
if ((0, core_1.isZWaveError)(e)
&& e.code === core_1.ZWaveErrorCodes.PacketFormat_InvalidPayload) {
const nodeId = options.fromEncapsulation

@@ -245,5 +245,5 @@ ? options.encapCC.nodeId

let reason;
if (typeof e.context === "string" ||
(typeof e.context === "number" &&
core_1.ZWaveErrorCodes[e.context] != undefined)) {
if (typeof e.context === "string"
|| (typeof e.context === "number"
&& core_1.ZWaveErrorCodes[e.context] != undefined)) {
reason = e.context;

@@ -509,5 +509,5 @@ }

shouldAutoCreateValue(applHost, value) {
return (value.options.autoCreate === true ||
(typeof value.options.autoCreate === "function" &&
value.options.autoCreate(applHost, this.getEndpoint(applHost))));
return (value.options.autoCreate === true
|| (typeof value.options.autoCreate === "function"
&& value.options.autoCreate(applHost, this.getEndpoint(applHost))));
}

@@ -542,4 +542,4 @@ /** Returns a list of all value names that are defined for this CommandClass */

// Skip those values that are only supported in higher versions of the CC
if (value.options.minVersion != undefined &&
value.options.minVersion > this._knownVersion) {
if (value.options.minVersion != undefined
&& value.options.minVersion > this._knownVersion) {
continue;

@@ -608,4 +608,4 @@ }

// Skip those values that are only supported in higher versions of the CC
if (value.options.minVersion != undefined &&
value.options.minVersion > this.version) {
if (value.options.minVersion != undefined
&& value.options.minVersion > this.version) {
continue;

@@ -616,9 +616,9 @@ }

// Metadata gets created for non-internal values...
const createMetadata = !value.options.internal &&
const createMetadata = !value.options.internal
// ... but only if the value is included in the report we are persisting
(sourceValue != undefined ||
&& (sourceValue != undefined
// ... or if we know which CC version the node supports
// and the value may be automatically created
(this._knownVersion >= value.options.minVersion &&
this.shouldAutoCreateValue(applHost, value)));
|| (this._knownVersion >= value.options.minVersion
&& this.shouldAutoCreateValue(applHost, value)));
if (createMetadata && !valueDB.hasMetadata(valueId)) {

@@ -661,4 +661,4 @@ valueDB.setMetadata(valueId, value.meta);

// Evaluate dynamic CC responses
if (typeof expected === "function" &&
!(0, shared_1.staticExtends)(expected, CommandClass)) {
if (typeof expected === "function"
&& !(0, shared_1.staticExtends)(expected, CommandClass)) {
expected = expected(this);

@@ -680,4 +680,4 @@ }

// Evaluate dynamic CC responses
if (typeof expected === "function" &&
!(0, shared_1.staticExtends)(expected, CommandClass)) {
if (typeof expected === "function"
&& !(0, shared_1.staticExtends)(expected, CommandClass)) {
expected = expected(this);

@@ -689,4 +689,4 @@ }

}
else if ((0, typeguards_1.isArray)(expected) &&
expected.every((cc) => (0, shared_1.staticExtends)(cc, CommandClass))) {
else if ((0, typeguards_1.isArray)(expected)
&& expected.every((cc) => (0, shared_1.staticExtends)(cc, CommandClass))) {
// The CC always expects a response from the given list, check if the received

@@ -707,4 +707,4 @@ // message is in that list

if (ret === "checkEncapsulated") {
if ((0, EncapsulatingCommandClass_1.isEncapsulatingCommandClass)(this) &&
(0, EncapsulatingCommandClass_1.isEncapsulatingCommandClass)(received)) {
if ((0, EncapsulatingCommandClass_1.isEncapsulatingCommandClass)(this)
&& (0, EncapsulatingCommandClass_1.isEncapsulatingCommandClass)(received)) {
return this.encapsulated.isExpectedCCResponse(received.encapsulated);

@@ -760,4 +760,4 @@ }

cc = cc.encapsulatingCC;
if (cc.ccId === ccId &&
(ccCommand === undefined || cc.ccCommand === ccCommand)) {
if (cc.ccId === ccId
&& (ccCommand === undefined || cc.ccCommand === ccCommand)) {
return true;

@@ -773,4 +773,4 @@ }

cc = cc.encapsulatingCC;
if (cc.ccId === ccId &&
(ccCommand === undefined || cc.ccCommand === ccCommand)) {
if (cc.ccId === ccId
&& (ccCommand === undefined || cc.ccCommand === ccCommand)) {
return cc;

@@ -782,4 +782,4 @@ }

getEncapsulatedCC(ccId, ccCommand) {
const predicate = (cc) => cc.ccId === ccId &&
(ccCommand === undefined || cc.ccCommand === ccCommand);
const predicate = (cc) => cc.ccId === ccId
&& (ccCommand === undefined || cc.ccCommand === ccCommand);
if ((0, EncapsulatingCommandClass_1.isEncapsulatingCommandClass)(this)) {

@@ -786,0 +786,0 @@ if (predicate(this.encapsulated))

@@ -69,4 +69,4 @@ "use strict";

// retrieve the current metadata
const ret = CCAndCommandDecorator.lookupSuperValueStatic(constr) ??
apiDecorator.lookupValueStatic(constr);
const ret = CCAndCommandDecorator.lookupSuperValueStatic(constr)
?? apiDecorator.lookupValueStatic(constr);
if (ret == undefined) {

@@ -73,0 +73,0 @@ throw new core_1.ZWaveError(`No command class defined for ${constr.name}!`, core_1.ZWaveErrorCodes.CC_Invalid);

@@ -47,4 +47,4 @@ "use strict";

// The encapsulated property must array of CCs
if (!((0, typeguards_1.isArray)(cc.encapsulated) &&
cc.encapsulated.every((item) => item instanceof CommandClass_1.CommandClass))) {
if (!((0, typeguards_1.isArray)(cc.encapsulated)
&& cc.encapsulated.every((item) => item instanceof CommandClass_1.CommandClass))) {
return false;

@@ -51,0 +51,0 @@ }

@@ -37,4 +37,4 @@ "use strict";

Reflect.defineMetadata(METADATA_S2Extension, type, extensionClass);
const map = Reflect.getMetadata(METADATA_S2ExtensionMap, Security2Extension) ||
new Map();
const map = Reflect.getMetadata(METADATA_S2ExtensionMap, Security2Extension)
|| new Map();
map.set(type, extensionClass);

@@ -95,5 +95,5 @@ Reflect.defineMetadata(METADATA_S2ExtensionMap, map, Security2Extension);

2 + this.payload.length,
(moreToFollow ? 128 : 0) |
(this.critical ? 64 : 0) |
(this.type & 63),
(moreToFollow ? 128 : 0)
| (this.critical ? 64 : 0)
| (this.type & 63),
]),

@@ -192,4 +192,4 @@ this.payload,

toLogEntry() {
const mpanState = process.env.NODE_ENV === "test" ||
process.env.NODE_ENV === "development"
const mpanState = process.env.NODE_ENV === "test"
|| process.env.NODE_ENV === "development"
? (0, safe_2.buffer2hex)(this.innerMPANState)

@@ -196,0 +196,0 @@ : "(hidden)";

@@ -56,4 +56,5 @@ "use strict";

function encodeSwitchpoint(point) {
if (point.state == undefined)
if (point.state == undefined) {
throw new core_1.ZWaveError("The given Switchpoint is not valid!", core_1.ZWaveErrorCodes.CC_Invalid);
}
return Buffer.from([

@@ -89,4 +90,4 @@ point.hour & 31,

function encodeTimezone(tz) {
if (Math.abs(tz.standardOffset) >= 24 * 60 ||
Math.abs(tz.dstOffset) >= 24 * 60) {
if (Math.abs(tz.standardOffset) >= 24 * 60
|| Math.abs(tz.dstOffset) >= 24 * 60) {
throw new core_1.ZWaveError("The given timezone is not valid!", core_1.ZWaveErrorCodes.CC_Invalid);

@@ -93,0 +94,0 @@ }

@@ -41,4 +41,4 @@ "use strict";

function setValueSucceeded(result) {
return (result.status === SetValueStatus.Success ||
result.status === SetValueStatus.Working);
return (result.status === SetValueStatus.Success
|| result.status === SetValueStatus.Working);
}

@@ -48,7 +48,7 @@ exports.setValueSucceeded = setValueSucceeded;

function setValueFailed(result) {
return (result.status === SetValueStatus.NoDeviceSupport ||
result.status === SetValueStatus.Fail ||
result.status === SetValueStatus.EndpointNotFound ||
result.status === SetValueStatus.NotImplemented ||
result.status === SetValueStatus.InvalidValue);
return (result.status === SetValueStatus.NoDeviceSupport
|| result.status === SetValueStatus.Fail
|| result.status === SetValueStatus.EndpointNotFound
|| result.status === SetValueStatus.NotImplemented
|| result.status === SetValueStatus.InvalidValue);
}

@@ -58,6 +58,6 @@ exports.setValueFailed = setValueFailed;

function setValueWasUnsupervisedOrSucceeded(result) {
return (result.status === SetValueStatus.SuccessUnsupervised ||
setValueSucceeded(result));
return (result.status === SetValueStatus.SuccessUnsupervised
|| setValueSucceeded(result));
}
exports.setValueWasUnsupervisedOrSucceeded = setValueWasUnsupervisedOrSucceeded;
//# sourceMappingURL=SetValueResult.js.map

@@ -32,4 +32,4 @@ "use strict";

// Eliminate potential duplicates
...assocs.filter((a1) => normalAssociations.findIndex((a2) => a1.nodeId === a2.nodeId &&
a1.endpoint === a2.endpoint) === -1),
...assocs.filter((a1) => normalAssociations.findIndex((a2) => a1.nodeId === a2.nodeId
&& a1.endpoint === a2.endpoint) === -1),
]);

@@ -65,4 +65,4 @@ }

: targetNode.getEndpointOrThrow(destination.endpoint ?? 0);
if (!endpoint.supportsCC(safe_1.CommandClasses.Association) &&
!endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
if (!endpoint.supportsCC(safe_1.CommandClasses.Association)
&& !endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
throw new safe_1.ZWaveError(`Node ${endpoint.nodeId}${endpoint.index > 0 ? `, endpoint ${endpoint.index}` : ""} does not support associations!`, safe_1.ZWaveErrorCodes.CC_NotSupported);

@@ -95,4 +95,4 @@ }

if (sourceSecurityClass != undefined && targetSecurityClass != undefined) {
if (securityClassMustMatch &&
sourceSecurityClass !== targetSecurityClass) {
if (securityClassMustMatch
&& sourceSecurityClass !== targetSecurityClass) {
return false;

@@ -102,6 +102,6 @@ }

// Commands to insecure nodes are allowed
targetSecurityClass !== safe_1.SecurityClass.None &&
targetSecurityClass !== safe_1.SecurityClass.None
// Otherwise, the sender must know the target's highest key
!securityClassMustMatch &&
!sourceNode.hasSecurityClass(targetSecurityClass)) {
&& !securityClassMustMatch
&& !sourceNode.hasSecurityClass(targetSecurityClass)) {
return false;

@@ -127,4 +127,4 @@ }

// actuator Command Class if the actual association group sends Basic Control Command Class.
if (groupCCs.includes(safe_1.CommandClasses.Basic) &&
safe_1.actuatorCCs.some((cc) => targetEndpoint?.supportsCC(cc))) {
if (groupCCs.includes(safe_1.CommandClasses.Basic)
&& safe_1.actuatorCCs.some((cc) => targetEndpoint?.supportsCC(cc))) {
return true;

@@ -150,3 +150,4 @@ }

const assocGroupCount = assocInstance.getGroupCountCached(applHost, endpoint) ?? 0;
const mcGroupCount = mcInstance?.getGroupCountCached(applHost, endpoint) ?? 0;
const mcGroupCount = mcInstance?.getGroupCountCached(applHost, endpoint)
?? 0;
const groupCount = Math.max(assocGroupCount, mcGroupCount);

@@ -169,7 +170,7 @@ const deviceConfig = applHost.getDeviceConfig?.(endpoint.nodeId);

// prefer the configured label if we have one
assocConfig?.label ??
assocConfig?.label
// the ones reported by AGI are sometimes pretty bad
agiInstance.getGroupNameCached(applHost, endpoint, group) ??
?? agiInstance.getGroupNameCached(applHost, endpoint, group)
// but still better than "unnamed"
`Unnamed group ${group}`,
?? `Unnamed group ${group}`,
multiChannel,

@@ -189,5 +190,5 @@ profile: agiInstance.getGroupProfileCached(applHost, endpoint, group),

? mcInstance
: assocInstance).getMaxNodesCached(applHost, endpoint, group) ||
assocConfig?.maxNodes ||
1,
: assocInstance).getMaxNodesCached(applHost, endpoint, group)
|| assocConfig?.maxNodes
|| 1,
isLifeline: assocConfig?.isLifeline ?? group === 1,

@@ -235,3 +236,4 @@ label: assocConfig?.label ?? `Unnamed group ${group}`,

const assocGroupCount = assocInstance?.getGroupCountCached(applHost, endpoint) ?? 0;
const mcGroupCount = mcInstance?.getGroupCountCached(applHost, endpoint) ?? 0;
const mcGroupCount = mcInstance?.getGroupCountCached(applHost, endpoint)
?? 0;
const groupCount = Math.max(assocGroupCount, mcGroupCount);

@@ -242,5 +244,5 @@ if (group > groupCount) {

const deviceConfig = applHost.getDeviceConfig?.(endpoint.nodeId);
const groupIsMultiChannel = !!mcInstance &&
group <= mcGroupCount &&
deviceConfig?.associations?.get(group)?.multiChannel !== false;
const groupIsMultiChannel = !!mcInstance
&& group <= mcGroupCount
&& deviceConfig?.associations?.get(group)?.multiChannel !== false;
if (groupIsMultiChannel) {

@@ -330,5 +332,5 @@ // Check that all associations are allowed

// devices do not correctly share the node list between the two commands
if (assocInstance &&
nodeAssociations.length > 0 &&
groupExistsAsNodeAssociation) {
if (assocInstance
&& nodeAssociations.length > 0
&& groupExistsAsNodeAssociation) {
const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, applHost, endpoint);

@@ -371,5 +373,4 @@ await api.removeNodeIds({

// The root endpoint's associations may be configured separately or as part of "endpoints"
associations =
deviceConfig?.associations ??
deviceConfig?.endpoints?.get(0)?.associations;
associations = deviceConfig?.associations
?? deviceConfig?.endpoints?.get(0)?.associations;
}

@@ -417,4 +418,4 @@ else {

.catch(() => undefined);
if (lifeline?.profile ===
_Types_1.AssociationGroupInfoProfile["General: Lifeline"]) {
if (lifeline?.profile
=== _Types_1.AssociationGroupInfoProfile["General: Lifeline"]) {
lifelineGroups.push(1);

@@ -443,5 +444,5 @@ }

const assocConfig = deviceConfig?.getAssociationConfigForEndpoint(endpoint.index, group);
const mustUseNodeAssociation = !groupSupportsMultiChannelAssociation ||
!nodeSupportsMultiChannel ||
assocConfig?.multiChannel === false;
const mustUseNodeAssociation = !groupSupportsMultiChannelAssociation
|| !nodeSupportsMultiChannel
|| assocConfig?.multiChannel === false;
let mustUseMultiChannelAssociation = false;

@@ -456,7 +457,7 @@ if (groupSupportsMultiChannelAssociation && nodeSupportsMultiChannel) {

const allEndpoints = node.getAllEndpoints();
if (allEndpoints.length > 1 &&
allEndpoints
if (allEndpoints.length > 1
&& allEndpoints
.filter((e) => e.index !== endpoint.index)
.every((e) => !e.supportsCC(safe_1.CommandClasses.Association) &&
!e.supportsCC(safe_1.CommandClasses["Multi Channel Association"]))) {
.every((e) => !e.supportsCC(safe_1.CommandClasses.Association)
&& !e.supportsCC(safe_1.CommandClasses["Multi Channel Association"]))) {
mustUseMultiChannelAssociation = true;

@@ -479,9 +480,9 @@ }

// Only consider a group if it doesn't share its associations with the root endpoint
mcInstance.getMaxNodesCached(applHost, endpoint, group) >
0 &&
!!mcInstance
mcInstance.getMaxNodesCached(applHost, endpoint, group)
> 0
&& !!mcInstance
.getAllDestinationsCached(applHost, endpoint)
.get(group)
?.some((addr) => addr.nodeId === ownNodeId &&
addr.endpoint == undefined)) {
?.some((addr) => addr.nodeId === ownNodeId
&& addr.endpoint == undefined)) {
return true;

@@ -493,5 +494,5 @@ }

// Only consider a group if it doesn't share its associations with the root endpoint
assocInstance.getMaxNodesCached(applHost, endpoint, group) >
0 &&
!!assocInstance
assocInstance.getMaxNodesCached(applHost, endpoint, group)
> 0
&& !!assocInstance
.getAllDestinationsCached(applHost, endpoint)

@@ -509,9 +510,9 @@ .get(group)

// Only consider a group if it doesn't share its associations with the root endpoint
mcInstance.getMaxNodesCached(applHost, endpoint, group) >
0 &&
mcInstance
mcInstance.getMaxNodesCached(applHost, endpoint, group)
> 0
&& mcInstance
.getAllDestinationsCached(applHost, endpoint)
.get(group)
?.some((addr) => addr.nodeId === ownNodeId &&
addr.endpoint === 0)) {
?.some((addr) => addr.nodeId === ownNodeId
&& addr.endpoint === 0)) {
return true;

@@ -527,9 +528,9 @@ }

.get(group)
?.filter((addr) => addr.nodeId === ownNodeId &&
addr.endpoint != undefined &&
addr.endpoint !== 0) ?? [];
?.filter((addr) => addr.nodeId === ownNodeId
&& addr.endpoint != undefined
&& addr.endpoint !== 0) ?? [];
// Clean them up first
if (invalidEndpointAssociations.length > 0 &&
mcAPI.isSupported() &&
groupSupportsMultiChannelAssociation) {
if (invalidEndpointAssociations.length > 0
&& mcAPI.isSupported()
&& groupSupportsMultiChannelAssociation) {
applHost.controllerLog.logNode(node.id, {

@@ -569,5 +570,6 @@ endpoint: endpoint.index,

}
else if (assocAPI.isSupported() &&
else if (assocAPI.isSupported()
// Some endpoint groups don't support having any destinations because they are shared with the root
assocInstance.getMaxNodesCached(applHost, endpoint, group) > 0) {
&& assocInstance.getMaxNodesCached(applHost, endpoint, group)
> 0) {
// We can use a node association, but first remove any possible endpoint associations

@@ -607,5 +609,5 @@ applHost.controllerLog.logNode(node.id, {

// Second try: Node association using the Multi Channel Association CC
if (!hasLifeline &&
mcAPI.isSupported() &&
mcInstance.getMaxNodesCached(applHost, endpoint, group) > 0) {
if (!hasLifeline
&& mcAPI.isSupported()
&& mcInstance.getMaxNodesCached(applHost, endpoint, group) > 0) {
// We can use a node association, but first remove any possible endpoint associations

@@ -658,5 +660,5 @@ applHost.controllerLog.logNode(node.id, {

}
else if (mcAPI.isSupported() &&
mcAPI.version >= 3 &&
mcInstance.getMaxNodesCached(applHost, endpoint, group) > 0) {
else if (mcAPI.isSupported()
&& mcAPI.version >= 3
&& mcInstance.getMaxNodesCached(applHost, endpoint, group) > 0) {
// We can use a multi channel association, but first remove any possible node associations

@@ -710,10 +712,11 @@ applHost.controllerLog.logNode(node.id, {

// we previously configured on the root.
if (!hasLifeline &&
group === 1 &&
node.supportsCC(safe_1.CommandClasses["Z-Wave Plus Info"]) &&
endpoint.index > 0) {
if (!hasLifeline
&& group === 1
&& node.supportsCC(safe_1.CommandClasses["Z-Wave Plus Info"])
&& endpoint.index > 0) {
// But first check if the root may have a multi channel association
const rootAssocConfig = deviceConfig?.getAssociationConfigForEndpoint(0, group);
const rootMustUseNodeAssociation = !nodeSupportsMultiChannel ||
rootAssocConfig?.multiChannel === false;
const rootAssocConfig = deviceConfig
?.getAssociationConfigForEndpoint(0, group);
const rootMustUseNodeAssociation = !nodeSupportsMultiChannel
|| rootAssocConfig?.multiChannel === false;
applHost.controllerLog.logNode(node.id, {

@@ -785,6 +788,7 @@ endpoint: endpoint.index,

const node = endpoint.getNodeUnsafe();
if (node.supportsCC(safe_1.CommandClasses["Association Group Information"]) &&
(node.supportsCC(safe_1.CommandClasses.Association) ||
node.supportsCC(safe_1.CommandClasses["Multi Channel Association"]))) {
const groupsIssueingNotifications = AssociationGroupInfoCC_1.AssociationGroupInfoCC.findGroupsForIssuedCommand(applHost, node, ccId, ccCommand);
if (node.supportsCC(safe_1.CommandClasses["Association Group Information"])
&& (node.supportsCC(safe_1.CommandClasses.Association)
|| node.supportsCC(safe_1.CommandClasses["Multi Channel Association"]))) {
const groupsIssueingNotifications = AssociationGroupInfoCC_1.AssociationGroupInfoCC
.findGroupsForIssuedCommand(applHost, node, ccId, ccCommand);
if (groupsIssueingNotifications.length > 0) {

@@ -810,4 +814,4 @@ // We always grab the first group - usually it should be the lifeline

// No association support means no unsolicited reports
if (!node.supportsCC(safe_1.CommandClasses.Association) &&
!node.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
if (!node.supportsCC(safe_1.CommandClasses.Association)
&& !node.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
return false;

@@ -814,0 +818,0 @@ }

@@ -1,2 +0,2 @@

import { ValueMetadata, type CommandClasses, type IZWaveEndpoint, type ValueID } from "@zwave-js/core";
import { type CommandClasses, type IZWaveEndpoint, type ValueID, ValueMetadata } from "@zwave-js/core";
import type { ZWaveApplicationHost } from "@zwave-js/host";

@@ -3,0 +3,0 @@ import type { Overwrite } from "alcalzone-shared/types";

@@ -43,5 +43,5 @@ "use strict";

is: (testValueId) => {
return (valueId.commandClass === testValueId.commandClass &&
valueId.property === testValueId.property &&
valueId.propertyKey === testValueId.propertyKey);
return (valueId.commandClass === testValueId.commandClass
&& valueId.property === testValueId.property
&& valueId.propertyKey === testValueId.propertyKey);
},

@@ -48,0 +48,0 @@ get meta() {

{
"name": "@zwave-js/cc",
"version": "11.13.0",
"version": "11.13.1",
"description": "zwave-js: Command Classes",

@@ -58,6 +58,4 @@ "keywords": [],

"ts": "node -r esbuild-register",
"lint:ts": "eslint --ext .ts --rule \"prettier/prettier: off\" \"src/**/*.ts\"",
"lint:ts": "eslint --ext .ts \"src/**/*.ts\"",
"lint:ts:fix": "yarn run lint:ts --fix",
"lint:prettier": "prettier -c \"src/**/*.ts\"",
"lint:prettier:fix": "yarn run lint:prettier -w",
"test:ts": "ava",

@@ -67,6 +65,6 @@ "test:dirty": "node -r ../../maintenance/esbuild-register.js ../maintenance/src/resolveDirtyTests.ts --run"

"dependencies": {
"@zwave-js/core": "11.13.0",
"@zwave-js/host": "11.13.0",
"@zwave-js/serial": "11.13.0",
"@zwave-js/shared": "11.13.0",
"@zwave-js/core": "11.13.1",
"@zwave-js/host": "11.13.1",
"@zwave-js/serial": "11.13.1",
"@zwave-js/shared": "11.13.1",
"alcalzone-shared": "^4.0.8",

@@ -80,11 +78,10 @@ "ansi-colors": "^4.1.3",

"@types/node": "^14.18.52",
"@zwave-js/maintenance": "11.13.0",
"@zwave-js/testing": "11.13.0",
"@zwave-js/transformers": "11.3.0",
"@zwave-js/maintenance": "11.13.1",
"@zwave-js/testing": "11.13.1",
"@zwave-js/transformers": "11.13.1",
"ava": "^4.3.3",
"del-cli": "^5.0.0",
"fs-extra": "^10.1.0",
"prettier": "^2.8.8",
"typescript": "5.1.6"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc