zwave-js 14.1.0 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/Driver.d.ts +1 -1
- package/build/cjs/Driver.js.map +1 -1
- package/build/cjs/lib/_version.d.ts +1 -1
- package/build/cjs/lib/_version.js +1 -1
- package/build/cjs/lib/_version.js.map +1 -1
- package/build/cjs/lib/controller/MockControllerBehaviors.js +2 -2
- package/build/cjs/lib/controller/MockControllerBehaviors.js.map +2 -2
- package/build/cjs/lib/driver/Driver.d.ts +1 -1
- package/build/cjs/lib/driver/Driver.js +9 -8
- package/build/cjs/lib/driver/Driver.js.map +2 -2
- package/build/cjs/lib/driver/MessageGenerators.js +4 -4
- package/build/cjs/lib/driver/MessageGenerators.js.map +2 -2
- package/build/cjs/lib/driver/NetworkCache.d.ts +1 -2
- package/build/cjs/lib/driver/NetworkCache.js.map +2 -2
- package/build/cjs/lib/driver/UpdateConfig.js +6 -4
- package/build/cjs/lib/driver/UpdateConfig.js.map +3 -3
- package/build/cjs/lib/driver/ZWaveOptions.d.ts +2 -2
- package/build/cjs/lib/driver/ZWaveOptions.js.map +2 -2
- package/build/cjs/lib/node/Node.js +2 -2
- package/build/cjs/lib/node/Node.js.map +3 -3
- package/build/cjs/lib/zniffer/Zniffer.js +4 -4
- package/build/cjs/lib/zniffer/Zniffer.js.map +2 -2
- package/build/esm/Driver.d.ts +1 -1
- package/build/esm/Driver.d.ts.map +1 -1
- package/build/esm/lib/_version.d.ts +1 -1
- package/build/esm/lib/_version.js +1 -1
- package/build/esm/lib/controller/MockControllerBehaviors.js +2 -2
- package/build/esm/lib/controller/MockControllerBehaviors.js.map +1 -1
- package/build/esm/lib/driver/Driver.d.ts +1 -1
- package/build/esm/lib/driver/Driver.d.ts.map +1 -1
- package/build/esm/lib/driver/Driver.js +9 -9
- package/build/esm/lib/driver/Driver.js.map +1 -1
- package/build/esm/lib/driver/MessageGenerators.d.ts.map +1 -1
- package/build/esm/lib/driver/MessageGenerators.js +4 -4
- package/build/esm/lib/driver/MessageGenerators.js.map +1 -1
- package/build/esm/lib/driver/NetworkCache.d.ts +1 -2
- package/build/esm/lib/driver/NetworkCache.d.ts.map +1 -1
- package/build/esm/lib/driver/NetworkCache.js.map +1 -1
- package/build/esm/lib/driver/UpdateConfig.d.ts.map +1 -1
- package/build/esm/lib/driver/UpdateConfig.js +6 -4
- package/build/esm/lib/driver/UpdateConfig.js.map +1 -1
- package/build/esm/lib/driver/ZWaveOptions.d.ts +2 -2
- package/build/esm/lib/driver/ZWaveOptions.d.ts.map +1 -1
- package/build/esm/lib/driver/ZWaveOptions.js.map +1 -1
- package/build/esm/lib/node/Node.js +2 -2
- package/build/esm/lib/node/Node.js.map +1 -1
- package/build/esm/lib/zniffer/Zniffer.d.ts.map +1 -1
- package/build/esm/lib/zniffer/Zniffer.js +4 -4
- package/build/esm/lib/zniffer/Zniffer.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/driver/ZWaveOptions.ts"],
|
|
4
|
-
"sourcesContent": ["import type { LogConfig, LongRangeChannel, RFRegion } from \"@zwave-js/core\";\nimport type { FileSystem, ZWaveHostOptions } from \"@zwave-js/host\";\nimport type { ZWaveSerialPortBase } from \"@zwave-js/serial\";\nimport { type DeepPartial, type Expand } from \"@zwave-js/shared\";\nimport type { SerialPort } from \"serialport\";\nimport type {\n\tInclusionUserCallbacks,\n\tJoinNetworkUserCallbacks,\n} from \"../controller/Inclusion.js\";\n\nexport interface ZWaveOptions extends ZWaveHostOptions {\n\t/** Specify timeouts in milliseconds */\n\ttimeouts: {\n\t\t/** how long to wait for an ACK */\n\t\tack: number; // >=1, default: 1000 ms\n\n\t\t/** not sure */\n\t\tbyte: number; // >=1, default: 150 ms\n\n\t\t/**\n\t\t * How long to wait for a controller response. Usually this should never elapse, but when it does,\n\t\t * the driver will abort the transmission and try to recover the controller if it is unresponsive.\n\t\t */\n\t\tresponse: number; // [500...60000], default: 10000 ms\n\n\t\t/**\n\t\t * How long to wait for a callback from the host for a SendData[Multicast]Request\n\t\t * before aborting the transmission.\n\t\t */\n\t\tsendDataAbort: number; // >=5000, <=(sendDataCallback - 5000), default: 20000 ms\n\n\t\t/**\n\t\t * How long to wait for a callback from the host for a SendData[Multicast]Request\n\t\t * before considering the controller unresponsive.\n\t\t */\n\t\tsendDataCallback: number; // >=10000, default: 30000 ms\n\n\t\t/** How much time a node gets to process a request and send a response */\n\t\treport: number; // [500...10000], default: 1000 ms\n\n\t\t/** How long generated nonces are valid */\n\t\tnonce: number; // [3000...20000], default: 5000 ms\n\n\t\t/** How long to wait before retrying a command when the controller is jammed */\n\t\tretryJammed: number; // [10...5000], default: 1000 ms\n\n\t\t/**\n\t\t * How long to wait without pending commands before sending a node back to sleep.\n\t\t * Should be as short as possible to save battery, but long enough to give applications time to react.\n\t\t */\n\t\tsendToSleep: number; // [10...5000], default: 250 ms\n\n\t\t/**\n\t\t * **!!! INTERNAL !!!**\n\t\t *\n\t\t * Not intended to be used by applications\n\t\t *\n\t\t * How long to wait for a poll after setting a value without transition duration\n\t\t */\n\t\trefreshValue: number;\n\n\t\t/**\n\t\t * **!!! INTERNAL !!!**\n\t\t *\n\t\t * Not intended to be used by applications\n\t\t *\n\t\t * How long to wait for a poll after setting a value with transition duration. This doubles as the \"fast\" delay.\n\t\t */\n\t\trefreshValueAfterTransition: number;\n\n\t\t/**\n\t\t * How long to wait for the Serial API Started command after a soft-reset before resorting\n\t\t * to polling the API for the responsiveness check.\n\t\t */\n\t\tserialAPIStarted: number; // [1000...30000], default: 5000 ms\n\t};\n\n\tattempts: {\n\t\t/**\n\t\t * @internal\n\t\t * How often to attempt opening the serial port\n\t\t */\n\t\topenSerialPort: number;\n\n\t\t/** How often the driver should try communication with the controller before giving up */\n\t\tcontroller: number; // [1...3], default: 3\n\n\t\t/** How often the driver should try sending SendData commands before giving up */\n\t\tsendData: number; // [1...5], default: 3\n\n\t\t/** How often the driver should retry SendData commands while the controller is jammed */\n\t\tsendDataJammed: number; // [1...10], default: 5\n\n\t\t/**\n\t\t * How many attempts should be made for each node interview before giving up\n\t\t */\n\t\tnodeInterview: number; // [1...10], default: 5\n\t};\n\n\t/**\n\t * Optional log configuration\n\t */\n\tlogConfig?: LogConfig;\n\n\tinterview: {\n\t\t/**\n\t\t * Whether all user code should be queried during the interview of the UserCode CC.\n\t\t * Note that enabling this can cause a lot of traffic during the interview.\n\t\t */\n\t\tqueryAllUserCodes?: boolean;\n\n\t\t/**\n\t\t * Disable the automatic node interview after successful inclusion.\n\t\t * Note: When this is `true`, the interview must be started manually using\n\t\t * ```ts\n\t\t * node.interview()\n\t\t * ```\n\t\t *\n\t\t * Default: `false` (automatic interviews enabled)\n\t\t */\n\t\tdisableOnNodeAdded?: boolean;\n\t};\n\n\tstorage: {\n\t\t/** Allows you to replace the default file system driver used to store and read the cache */\n\t\tdriver: FileSystem;\n\t\t/** Allows you to specify a different cache directory */\n\t\tcacheDir: string;\n\t\t/**\n\t\t * Allows you to specify a different directory for the lockfiles than cacheDir.\n\t\t * Can also be set with the ZWAVEJS_LOCK_DIRECTORY env variable.\n\t\t */\n\t\tlockDir?: string;\n\n\t\t/**\n\t\t * Allows you to specify a directory where the embedded device configuration files are stored.\n\t\t * When set, the configuration files can automatically be updated using `Driver.installConfigUpdate()`\n\t\t * without having to update the npm packages.\n\t\t * Can also be set using the ZWAVEJS_EXTERNAL_CONFIG env variable.\n\t\t */\n\t\tdeviceConfigExternalDir?: string;\n\n\t\t/**\n\t\t * Allows you to specify a directory where device configuration files can be loaded from with higher priority than the included ones.\n\t\t * This directory does not get indexed and should be used sparingly, e.g. for testing.\n\t\t */\n\t\tdeviceConfigPriorityDir?: string;\n\n\t\t/**\n\t\t * How frequently the values and metadata should be written to the DB files. This is a compromise between data loss\n\t\t * in cause of a crash and disk wear:\n\t\t *\n\t\t * * `\"fast\"` immediately writes every change to disk\n\t\t * * `\"slow\"` writes at most every 5 minutes or after 500 changes - whichever happens first\n\t\t * * `\"normal\"` is a compromise between the two options\n\t\t */\n\t\tthrottle: \"fast\" | \"normal\" | \"slow\";\n\t};\n\n\t/**\n\t * Specify the security keys to use for encryption (Z-Wave Classic). Each one must be a Buffer of exactly 16 bytes.\n\t */\n\tsecurityKeys?: {\n\t\tS2_AccessControl?: Uint8Array;\n\t\tS2_Authenticated?: Uint8Array;\n\t\tS2_Unauthenticated?: Uint8Array;\n\t\tS0_Legacy?: Uint8Array;\n\t};\n\n\t/**\n\t * Specify the security keys to use for encryption (Z-Wave Long Range). Each one must be a Buffer of exactly 16 bytes.\n\t */\n\tsecurityKeysLongRange?: {\n\t\tS2_AccessControl?: Uint8Array;\n\t\tS2_Authenticated?: Uint8Array;\n\t};\n\n\t/**\n\t * Defines the callbacks that are necessary to trigger user interaction during S2 inclusion.\n\t * If not given, nodes won't be included using S2, unless matching provisioning entries exists.\n\t */\n\tinclusionUserCallbacks?: InclusionUserCallbacks;\n\n\t/**\n\t * Defines the callbacks that are necessary to trigger user interaction during S2 bootstrapping when joining a network.\n\t * If not given, joining a network with S2 may not be possible, unless the application handles\n\t * displaying the DSK to the user on its own.\n\t */\n\tjoinNetworkUserCallbacks?: JoinNetworkUserCallbacks;\n\n\t/**\n\t * Some SET-type commands optimistically update the current value to match the target value\n\t * when the device acknowledges the command.\n\t *\n\t * While this generally makes UIs feel more responsive, it is not necessary for devices which report their status\n\t * on their own and can lead to confusing behavior when dealing with slow devices like blinds.\n\t *\n\t * To disable the optimistic update, set this option to `true`.\n\t * Default: `false`\n\t */\n\tdisableOptimisticValueUpdate?: boolean;\n\n\t/**\n\t * By default, the driver assumes to be talking to a single application. In this scenario a successful `setValue` call\n\t * is enough for the application to know that the value was changed and update its own cache or UI.\n\t *\n\t * Therefore, the `\"value updated\"` event is not emitted after `setValue` unless the change was verified by the device.\n\t * To get `\"value updated\"` events nonetheless, set this option to `true`.\n\t *\n\t * Default: `false`\n\t */\n\temitValueUpdateAfterSetValue?: boolean;\n\n\tfeatures: {\n\t\t/**\n\t\t * Soft Reset is required after some commands like changing the RF region or restoring an NVM backup.\n\t\t * Because it may be problematic in certain environments, we provide the user with an option to opt out.\n\t\t * Default: `true,` except when ZWAVEJS_DISABLE_SOFT_RESET env variable is set.\n\t\t *\n\t\t * **Note:** This option has no effect on 700+ series controllers. For those, soft reset is always enabled.\n\t\t */\n\t\tsoftReset?: boolean;\n\n\t\t/**\n\t\t * When enabled, the driver attempts to detect when the controller becomes unresponsive (meaning it did not\n\t\t * respond within the configured timeout) and performs appropriate recovery actions.\n\t\t *\n\t\t * This includes the following scenarios:\n\t\t * * A command was not acknowledged by the controller\n\t\t * * The callback for a Send Data command was not received, even after aborting a timed out transmission\n\t\t *\n\t\t * In certain environments however, this feature can interfere with the normal operation more than intended,\n\t\t * so it can be disabled. However disabling it means that commands can fail unnecessarily and nodes can be\n\t\t * incorrectly marked as dead.\n\t\t *\n\t\t * Default: `true`, except when the ZWAVEJS_DISABLE_UNRESPONSIVE_CONTROLLER_RECOVERY env variable is set.\n\t\t */\n\t\tunresponsiveControllerRecovery?: boolean;\n\n\t\t/**\n\t\t * Controllers of the 700 series and newer have a hardware watchdog that can be enabled to automatically\n\t\t * reset the chip in case it becomes unresponsive. This option controls whether the watchdog should be enabled.\n\t\t *\n\t\t * Default: `true`, except when the ZWAVEJS_DISABLE_WATCHDOG env variable is set.\n\t\t */\n\t\twatchdog?: boolean;\n\t};\n\n\tpreferences: {\n\t\t/**\n\t\t * The preferred scales to use when querying sensors. The key is either:\n\t\t * - the name of a named scale group, e.g. \"temperature\", which applies to every sensor type that uses this scale group.\n\t\t * - or the numeric sensor type to specify the scale for a single sensor type\n\t\t *\n\t\t * Single-type preferences have a higher priority than named ones. For example, the following preference\n\t\t * ```js\n\t\t * {\n\t\t * temperature: \"\u00B0F\",\n\t\t * 0x01: \"\u00B0C\",\n\t\t * }\n\t\t * ```\n\t\t * will result in using the Fahrenheit scale for all temperature sensors, except the air temperature (0x01).\n\t\t *\n\t\t * The value must match what is defined in the sensor type config file and contain either:\n\t\t * - the label (e.g. \"Celsius\", \"Fahrenheit\")\n\t\t * - the unit (e.g. \"\u00B0C\", \"\u00B0F\")\n\t\t * - or the numeric key of the scale (e.g. 0 or 1).\n\t\t *\n\t\t * Default:\n\t\t * ```js\n\t\t * {\n\t\t * temperature: \"Celsius\"\n\t\t * }\n\t\t * ```\n\t\t */\n\t\tscales: Partial<Record<string | number, string | number>>;\n\t};\n\n\t/**\n\t * RF-related settings that should automatically be configured on startup. If Z-Wave JS detects\n\t * a discrepancy between these settings and the actual configuration, it will automatically try to\n\t * re-configure the controller to match.\n\t */\n\trf?: {\n\t\t/** The RF region the radio should be tuned to. */\n\t\tregion?: RFRegion;\n\n\t\t/**\n\t\t * Whether LR-capable regions should automatically be preferred over their corresponding non-LR regions, e.g. `USA` -> `USA (Long Range)`.\n\t\t * This also overrides the `rf.region` setting if the desired region is not LR-capable.\n\t\t *\n\t\t * Default: true.\n\t\t */\n\t\tpreferLRRegion?: boolean;\n\n\t\ttxPower?: {\n\t\t\t/** The desired TX power in dBm. */\n\t\t\tpowerlevel: number;\n\t\t\t/** A hardware-specific calibration value. */\n\t\t\tmeasured0dBm: number;\n\t\t};\n\n\t\t/** The desired max. powerlevel setting for Z-Wave Long Range in dBm. */\n\t\tmaxLongRangePowerlevel?: number;\n\n\t\t/**\n\t\t * The desired channel to use for Z-Wave Long Range.\n\t\t * Auto may be unsupported by the controller and will be ignored in that case.\n\t\t */\n\t\tlongRangeChannel?:\n\t\t\t| LongRangeChannel.A\n\t\t\t| LongRangeChannel.B\n\t\t\t| LongRangeChannel.Auto;\n\t};\n\n\tapiKeys?: {\n\t\t/** API key for the Z-Wave JS Firmware Update Service (https://github.com/zwave-js/firmware-updates/) */\n\t\tfirmwareUpdateService?: string;\n\t};\n\n\t/**\n\t * Normally, the driver expects to start in Serial API mode and enter the bootloader on demand. If in bootloader,\n\t * it will try to exit it and enter Serial API mode again.\n\t *\n\t * However there are situations where a controller may be stuck in bootloader mode and no Serial API is available.\n\t * In this case, the driver startup will fail, unless this option is set to `true`.\n\t *\n\t * If it is, the driver instance will only be good for interacting with the bootloader, e.g. for flashing a new image.\n\t * Commands attempting to talk to the serial API will fail.\n\t */\n\tallowBootloaderOnly?: boolean;\n\n\t/**\n\t * An object with application/module/component names and their versions.\n\t * This will be used to build a user-agent string for requests to Z-Wave JS webservices.\n\t */\n\tuserAgent?: Record<string, string>;\n\n\t/**\n\t * Specify application-specific information to use in queries from other devices\n\t */\n\tvendor?: {\n\t\tmanufacturerId: number;\n\t\tproductType: number;\n\t\tproductId: number;\n\n\t\t/** The version of the hardware the application is running on. Can be omitted if unknown. */\n\t\thardwareVersion?: number;\n\n\t\t/** The icon type to use for installers. Default: 0x0500 - Generic Gateway */\n\t\tinstallerIcon?: number;\n\t\t/** The icon type to use for users. Default: 0x0500 - Generic Gateway */\n\t\tuserIcon?: number;\n\t};\n\n\t/** DO NOT USE! Used for testing internally */\n\ttestingHooks?: {\n\t\tserialPortBinding?: typeof SerialPort;\n\t\t/**\n\t\t * A hook that allows accessing the serial port instance after opening\n\t\t * and before interacting with it.\n\t\t */\n\t\tonSerialPortOpen?: (port: ZWaveSerialPortBase) => Promise<void>;\n\n\t\t/**\n\t\t * Set this to true to skip the controller identification sequence.\n\t\t */\n\t\tskipControllerIdentification?: boolean;\n\n\t\t/**\n\t\t * Set this to true to skip the interview of all nodes.\n\t\t */\n\t\tskipNodeInterview?: boolean;\n\n\t\t/**\n\t\t * Set this to true to skip checking if the controller is in bootloader mode\n\t\t */\n\t\tskipBootloaderCheck?: boolean;\n\n\t\t/**\n\t\t * Set this to false to skip loading the configuration files. Default: `true`..\n\t\t */\n\t\tloadConfiguration?: boolean;\n\t};\n}\n\nexport type PartialZWaveOptions = Expand<\n\t& DeepPartial<\n\t\tOmit<\n\t\t\tZWaveOptions,\n\t\t\t| \"inclusionUserCallbacks\"\n\t\t\t| \"joinNetworkUserCallbacks\"\n\t\t\t| \"logConfig\"\n\t\t\t| \"testingHooks\"\n\t\t>\n\t>\n\t& Partial<\n\t\tPick<\n\t\t\tZWaveOptions,\n\t\t\t| \"testingHooks\"\n\t\t\t| \"vendor\"\n\t\t>\n\t>\n\t& {\n\t\tinclusionUserCallbacks?: ZWaveOptions[\"inclusionUserCallbacks\"];\n\t\tjoinNetworkUserCallbacks?: ZWaveOptions[\"joinNetworkUserCallbacks\"];\n\t\tlogConfig?: Partial<LogConfig>;\n\t}\n>;\n\nexport type EditableZWaveOptions = Expand<\n\t& Pick<\n\t\tPartialZWaveOptions,\n\t\t| \"disableOptimisticValueUpdate\"\n\t\t| \"emitValueUpdateAfterSetValue\"\n\t\t| \"inclusionUserCallbacks\"\n\t\t| \"joinNetworkUserCallbacks\"\n\t\t| \"interview\"\n\t\t| \"logConfig\"\n\t\t| \"preferences\"\n\t\t| \"vendor\"\n\t>\n\t& {\n\t\tuserAgent?: Record<string, string | null | undefined>;\n\t}\n>;\n\nexport const driverPresets = Object.freeze(\n\t{\n\t\t/**\n\t\t * Increases several timeouts to be able to deal with controllers\n\t\t * and/or nodes that have severe trouble communicating.\n\t\t */\n\t\tSAFE_MODE: {\n\t\t\ttimeouts: {\n\t\t\t\t// 500 series controllers that take long to respond instead of delaying the callback\n\t\t\t\tresponse: 60000,\n\t\t\t\t// Any controller having trouble reaching a node\n\t\t\t\tsendDataAbort: 60000,\n\t\t\t\tsendDataCallback: 65000,\n\t\t\t\t// Slow nodes taking long to respond\n\t\t\t\treport: 10000,\n\t\t\t\tnonce: 20000,\n\t\t\t},\n\t\t\tattempts: {\n\t\t\t\t// Increase communication attempts with nodes to their maximum\n\t\t\t\tsendData: 5,\n\t\t\t\tsendDataJammed: 10,\n\t\t\t\tnodeInterview: 10,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Disables the unresponsive controller recovery to be able to deal with controllers\n\t\t * that frequently become unresponsive for seemingly no reason.\n\t\t */\n\t\tNO_CONTROLLER_RECOVERY: {\n\t\t\tfeatures: {\n\t\t\t\tunresponsiveControllerRecovery: false,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Prevents enabling the watchdog to be able to deal with controllers\n\t\t * which frequently get restarted for seemingly no reason.\n\t\t */\n\t\tNO_WATCHDOG: {\n\t\t\tfeatures: {\n\t\t\t\twatchdog: false,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sends battery powered nodes to sleep more quickly in order to save battery.\n\t\t */\n\t\tBATTERY_SAVE: {\n\t\t\ttimeouts: {\n\t\t\t\tsendToSleep: 100,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sends battery powered nodes to sleep less quickly to give applications\n\t\t * more time between interactions.\n\t\t */\n\t\tAWAKE_LONGER: {\n\t\t\ttimeouts: {\n\t\t\t\tsendToSleep: 1000,\n\t\t\t},\n\t\t},\n\t} as const satisfies Record<string, PartialZWaveOptions>,\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;
|
|
4
|
+
"sourcesContent": ["import type {\n\tFileSystem,\n\tLogConfig,\n\tLongRangeChannel,\n\tRFRegion,\n} from \"@zwave-js/core\";\nimport type { ZWaveHostOptions } from \"@zwave-js/host\";\nimport type { ZWaveSerialPortBase } from \"@zwave-js/serial\";\nimport { type DeepPartial, type Expand } from \"@zwave-js/shared\";\nimport type { SerialPort } from \"serialport\";\nimport type {\n\tInclusionUserCallbacks,\n\tJoinNetworkUserCallbacks,\n} from \"../controller/Inclusion.js\";\n\nexport interface ZWaveOptions extends ZWaveHostOptions {\n\t/** Specify timeouts in milliseconds */\n\ttimeouts: {\n\t\t/** how long to wait for an ACK */\n\t\tack: number; // >=1, default: 1000 ms\n\n\t\t/** not sure */\n\t\tbyte: number; // >=1, default: 150 ms\n\n\t\t/**\n\t\t * How long to wait for a controller response. Usually this should never elapse, but when it does,\n\t\t * the driver will abort the transmission and try to recover the controller if it is unresponsive.\n\t\t */\n\t\tresponse: number; // [500...60000], default: 10000 ms\n\n\t\t/**\n\t\t * How long to wait for a callback from the host for a SendData[Multicast]Request\n\t\t * before aborting the transmission.\n\t\t */\n\t\tsendDataAbort: number; // >=5000, <=(sendDataCallback - 5000), default: 20000 ms\n\n\t\t/**\n\t\t * How long to wait for a callback from the host for a SendData[Multicast]Request\n\t\t * before considering the controller unresponsive.\n\t\t */\n\t\tsendDataCallback: number; // >=10000, default: 30000 ms\n\n\t\t/** How much time a node gets to process a request and send a response */\n\t\treport: number; // [500...10000], default: 1000 ms\n\n\t\t/** How long generated nonces are valid */\n\t\tnonce: number; // [3000...20000], default: 5000 ms\n\n\t\t/** How long to wait before retrying a command when the controller is jammed */\n\t\tretryJammed: number; // [10...5000], default: 1000 ms\n\n\t\t/**\n\t\t * How long to wait without pending commands before sending a node back to sleep.\n\t\t * Should be as short as possible to save battery, but long enough to give applications time to react.\n\t\t */\n\t\tsendToSleep: number; // [10...5000], default: 250 ms\n\n\t\t/**\n\t\t * **!!! INTERNAL !!!**\n\t\t *\n\t\t * Not intended to be used by applications\n\t\t *\n\t\t * How long to wait for a poll after setting a value without transition duration\n\t\t */\n\t\trefreshValue: number;\n\n\t\t/**\n\t\t * **!!! INTERNAL !!!**\n\t\t *\n\t\t * Not intended to be used by applications\n\t\t *\n\t\t * How long to wait for a poll after setting a value with transition duration. This doubles as the \"fast\" delay.\n\t\t */\n\t\trefreshValueAfterTransition: number;\n\n\t\t/**\n\t\t * How long to wait for the Serial API Started command after a soft-reset before resorting\n\t\t * to polling the API for the responsiveness check.\n\t\t */\n\t\tserialAPIStarted: number; // [1000...30000], default: 5000 ms\n\t};\n\n\tattempts: {\n\t\t/**\n\t\t * @internal\n\t\t * How often to attempt opening the serial port\n\t\t */\n\t\topenSerialPort: number;\n\n\t\t/** How often the driver should try communication with the controller before giving up */\n\t\tcontroller: number; // [1...3], default: 3\n\n\t\t/** How often the driver should try sending SendData commands before giving up */\n\t\tsendData: number; // [1...5], default: 3\n\n\t\t/** How often the driver should retry SendData commands while the controller is jammed */\n\t\tsendDataJammed: number; // [1...10], default: 5\n\n\t\t/**\n\t\t * How many attempts should be made for each node interview before giving up\n\t\t */\n\t\tnodeInterview: number; // [1...10], default: 5\n\t};\n\n\t/**\n\t * Optional log configuration\n\t */\n\tlogConfig?: LogConfig;\n\n\tinterview: {\n\t\t/**\n\t\t * Whether all user code should be queried during the interview of the UserCode CC.\n\t\t * Note that enabling this can cause a lot of traffic during the interview.\n\t\t */\n\t\tqueryAllUserCodes?: boolean;\n\n\t\t/**\n\t\t * Disable the automatic node interview after successful inclusion.\n\t\t * Note: When this is `true`, the interview must be started manually using\n\t\t * ```ts\n\t\t * node.interview()\n\t\t * ```\n\t\t *\n\t\t * Default: `false` (automatic interviews enabled)\n\t\t */\n\t\tdisableOnNodeAdded?: boolean;\n\t};\n\n\tstorage: {\n\t\t/** Allows you to replace the default file system driver used to store and read the cache */\n\t\tdriver: FileSystem;\n\t\t/** Allows you to specify a different cache directory */\n\t\tcacheDir: string;\n\t\t/**\n\t\t * Allows you to specify a different directory for the lockfiles than cacheDir.\n\t\t * Can also be set with the ZWAVEJS_LOCK_DIRECTORY env variable.\n\t\t */\n\t\tlockDir?: string;\n\n\t\t/**\n\t\t * Allows you to specify a directory where the embedded device configuration files are stored.\n\t\t * When set, the configuration files can automatically be updated using `Driver.installConfigUpdate()`\n\t\t * without having to update the npm packages.\n\t\t * Can also be set using the ZWAVEJS_EXTERNAL_CONFIG env variable.\n\t\t */\n\t\tdeviceConfigExternalDir?: string;\n\n\t\t/**\n\t\t * Allows you to specify a directory where device configuration files can be loaded from with higher priority than the included ones.\n\t\t * This directory does not get indexed and should be used sparingly, e.g. for testing.\n\t\t */\n\t\tdeviceConfigPriorityDir?: string;\n\n\t\t/**\n\t\t * How frequently the values and metadata should be written to the DB files. This is a compromise between data loss\n\t\t * in cause of a crash and disk wear:\n\t\t *\n\t\t * * `\"fast\"` immediately writes every change to disk\n\t\t * * `\"slow\"` writes at most every 5 minutes or after 500 changes - whichever happens first\n\t\t * * `\"normal\"` is a compromise between the two options\n\t\t */\n\t\tthrottle: \"fast\" | \"normal\" | \"slow\";\n\t};\n\n\t/**\n\t * Specify the security keys to use for encryption (Z-Wave Classic). Each one must be a Buffer of exactly 16 bytes.\n\t */\n\tsecurityKeys?: {\n\t\tS2_AccessControl?: Uint8Array;\n\t\tS2_Authenticated?: Uint8Array;\n\t\tS2_Unauthenticated?: Uint8Array;\n\t\tS0_Legacy?: Uint8Array;\n\t};\n\n\t/**\n\t * Specify the security keys to use for encryption (Z-Wave Long Range). Each one must be a Buffer of exactly 16 bytes.\n\t */\n\tsecurityKeysLongRange?: {\n\t\tS2_AccessControl?: Uint8Array;\n\t\tS2_Authenticated?: Uint8Array;\n\t};\n\n\t/**\n\t * Defines the callbacks that are necessary to trigger user interaction during S2 inclusion.\n\t * If not given, nodes won't be included using S2, unless matching provisioning entries exists.\n\t */\n\tinclusionUserCallbacks?: InclusionUserCallbacks;\n\n\t/**\n\t * Defines the callbacks that are necessary to trigger user interaction during S2 bootstrapping when joining a network.\n\t * If not given, joining a network with S2 may not be possible, unless the application handles\n\t * displaying the DSK to the user on its own.\n\t */\n\tjoinNetworkUserCallbacks?: JoinNetworkUserCallbacks;\n\n\t/**\n\t * Some SET-type commands optimistically update the current value to match the target value\n\t * when the device acknowledges the command.\n\t *\n\t * While this generally makes UIs feel more responsive, it is not necessary for devices which report their status\n\t * on their own and can lead to confusing behavior when dealing with slow devices like blinds.\n\t *\n\t * To disable the optimistic update, set this option to `true`.\n\t * Default: `false`\n\t */\n\tdisableOptimisticValueUpdate?: boolean;\n\n\t/**\n\t * By default, the driver assumes to be talking to a single application. In this scenario a successful `setValue` call\n\t * is enough for the application to know that the value was changed and update its own cache or UI.\n\t *\n\t * Therefore, the `\"value updated\"` event is not emitted after `setValue` unless the change was verified by the device.\n\t * To get `\"value updated\"` events nonetheless, set this option to `true`.\n\t *\n\t * Default: `false`\n\t */\n\temitValueUpdateAfterSetValue?: boolean;\n\n\tfeatures: {\n\t\t/**\n\t\t * Soft Reset is required after some commands like changing the RF region or restoring an NVM backup.\n\t\t * Because it may be problematic in certain environments, we provide the user with an option to opt out.\n\t\t * Default: `true,` except when ZWAVEJS_DISABLE_SOFT_RESET env variable is set.\n\t\t *\n\t\t * **Note:** This option has no effect on 700+ series controllers. For those, soft reset is always enabled.\n\t\t */\n\t\tsoftReset?: boolean;\n\n\t\t/**\n\t\t * When enabled, the driver attempts to detect when the controller becomes unresponsive (meaning it did not\n\t\t * respond within the configured timeout) and performs appropriate recovery actions.\n\t\t *\n\t\t * This includes the following scenarios:\n\t\t * * A command was not acknowledged by the controller\n\t\t * * The callback for a Send Data command was not received, even after aborting a timed out transmission\n\t\t *\n\t\t * In certain environments however, this feature can interfere with the normal operation more than intended,\n\t\t * so it can be disabled. However disabling it means that commands can fail unnecessarily and nodes can be\n\t\t * incorrectly marked as dead.\n\t\t *\n\t\t * Default: `true`, except when the ZWAVEJS_DISABLE_UNRESPONSIVE_CONTROLLER_RECOVERY env variable is set.\n\t\t */\n\t\tunresponsiveControllerRecovery?: boolean;\n\n\t\t/**\n\t\t * Controllers of the 700 series and newer have a hardware watchdog that can be enabled to automatically\n\t\t * reset the chip in case it becomes unresponsive. This option controls whether the watchdog should be enabled.\n\t\t *\n\t\t * Default: `true`, except when the ZWAVEJS_DISABLE_WATCHDOG env variable is set.\n\t\t */\n\t\twatchdog?: boolean;\n\t};\n\n\tpreferences: {\n\t\t/**\n\t\t * The preferred scales to use when querying sensors. The key is either:\n\t\t * - the name of a named scale group, e.g. \"temperature\", which applies to every sensor type that uses this scale group.\n\t\t * - or the numeric sensor type to specify the scale for a single sensor type\n\t\t *\n\t\t * Single-type preferences have a higher priority than named ones. For example, the following preference\n\t\t * ```js\n\t\t * {\n\t\t * temperature: \"\u00B0F\",\n\t\t * 0x01: \"\u00B0C\",\n\t\t * }\n\t\t * ```\n\t\t * will result in using the Fahrenheit scale for all temperature sensors, except the air temperature (0x01).\n\t\t *\n\t\t * The value must match what is defined in the sensor type config file and contain either:\n\t\t * - the label (e.g. \"Celsius\", \"Fahrenheit\")\n\t\t * - the unit (e.g. \"\u00B0C\", \"\u00B0F\")\n\t\t * - or the numeric key of the scale (e.g. 0 or 1).\n\t\t *\n\t\t * Default:\n\t\t * ```js\n\t\t * {\n\t\t * temperature: \"Celsius\"\n\t\t * }\n\t\t * ```\n\t\t */\n\t\tscales: Partial<Record<string | number, string | number>>;\n\t};\n\n\t/**\n\t * RF-related settings that should automatically be configured on startup. If Z-Wave JS detects\n\t * a discrepancy between these settings and the actual configuration, it will automatically try to\n\t * re-configure the controller to match.\n\t */\n\trf?: {\n\t\t/** The RF region the radio should be tuned to. */\n\t\tregion?: RFRegion;\n\n\t\t/**\n\t\t * Whether LR-capable regions should automatically be preferred over their corresponding non-LR regions, e.g. `USA` -> `USA (Long Range)`.\n\t\t * This also overrides the `rf.region` setting if the desired region is not LR-capable.\n\t\t *\n\t\t * Default: true.\n\t\t */\n\t\tpreferLRRegion?: boolean;\n\n\t\ttxPower?: {\n\t\t\t/** The desired TX power in dBm. */\n\t\t\tpowerlevel: number;\n\t\t\t/** A hardware-specific calibration value. */\n\t\t\tmeasured0dBm: number;\n\t\t};\n\n\t\t/** The desired max. powerlevel setting for Z-Wave Long Range in dBm. */\n\t\tmaxLongRangePowerlevel?: number;\n\n\t\t/**\n\t\t * The desired channel to use for Z-Wave Long Range.\n\t\t * Auto may be unsupported by the controller and will be ignored in that case.\n\t\t */\n\t\tlongRangeChannel?:\n\t\t\t| LongRangeChannel.A\n\t\t\t| LongRangeChannel.B\n\t\t\t| LongRangeChannel.Auto;\n\t};\n\n\tapiKeys?: {\n\t\t/** API key for the Z-Wave JS Firmware Update Service (https://github.com/zwave-js/firmware-updates/) */\n\t\tfirmwareUpdateService?: string;\n\t};\n\n\t/**\n\t * Normally, the driver expects to start in Serial API mode and enter the bootloader on demand. If in bootloader,\n\t * it will try to exit it and enter Serial API mode again.\n\t *\n\t * However there are situations where a controller may be stuck in bootloader mode and no Serial API is available.\n\t * In this case, the driver startup will fail, unless this option is set to `true`.\n\t *\n\t * If it is, the driver instance will only be good for interacting with the bootloader, e.g. for flashing a new image.\n\t * Commands attempting to talk to the serial API will fail.\n\t */\n\tallowBootloaderOnly?: boolean;\n\n\t/**\n\t * An object with application/module/component names and their versions.\n\t * This will be used to build a user-agent string for requests to Z-Wave JS webservices.\n\t */\n\tuserAgent?: Record<string, string>;\n\n\t/**\n\t * Specify application-specific information to use in queries from other devices\n\t */\n\tvendor?: {\n\t\tmanufacturerId: number;\n\t\tproductType: number;\n\t\tproductId: number;\n\n\t\t/** The version of the hardware the application is running on. Can be omitted if unknown. */\n\t\thardwareVersion?: number;\n\n\t\t/** The icon type to use for installers. Default: 0x0500 - Generic Gateway */\n\t\tinstallerIcon?: number;\n\t\t/** The icon type to use for users. Default: 0x0500 - Generic Gateway */\n\t\tuserIcon?: number;\n\t};\n\n\t/** DO NOT USE! Used for testing internally */\n\ttestingHooks?: {\n\t\tserialPortBinding?: typeof SerialPort;\n\t\t/**\n\t\t * A hook that allows accessing the serial port instance after opening\n\t\t * and before interacting with it.\n\t\t */\n\t\tonSerialPortOpen?: (port: ZWaveSerialPortBase) => Promise<void>;\n\n\t\t/**\n\t\t * Set this to true to skip the controller identification sequence.\n\t\t */\n\t\tskipControllerIdentification?: boolean;\n\n\t\t/**\n\t\t * Set this to true to skip the interview of all nodes.\n\t\t */\n\t\tskipNodeInterview?: boolean;\n\n\t\t/**\n\t\t * Set this to true to skip checking if the controller is in bootloader mode\n\t\t */\n\t\tskipBootloaderCheck?: boolean;\n\n\t\t/**\n\t\t * Set this to false to skip loading the configuration files. Default: `true`..\n\t\t */\n\t\tloadConfiguration?: boolean;\n\t};\n}\n\nexport type PartialZWaveOptions = Expand<\n\t& DeepPartial<\n\t\tOmit<\n\t\t\tZWaveOptions,\n\t\t\t| \"inclusionUserCallbacks\"\n\t\t\t| \"joinNetworkUserCallbacks\"\n\t\t\t| \"logConfig\"\n\t\t\t| \"testingHooks\"\n\t\t>\n\t>\n\t& Partial<\n\t\tPick<\n\t\t\tZWaveOptions,\n\t\t\t| \"testingHooks\"\n\t\t\t| \"vendor\"\n\t\t>\n\t>\n\t& {\n\t\tinclusionUserCallbacks?: ZWaveOptions[\"inclusionUserCallbacks\"];\n\t\tjoinNetworkUserCallbacks?: ZWaveOptions[\"joinNetworkUserCallbacks\"];\n\t\tlogConfig?: Partial<LogConfig>;\n\t}\n>;\n\nexport type EditableZWaveOptions = Expand<\n\t& Pick<\n\t\tPartialZWaveOptions,\n\t\t| \"disableOptimisticValueUpdate\"\n\t\t| \"emitValueUpdateAfterSetValue\"\n\t\t| \"inclusionUserCallbacks\"\n\t\t| \"joinNetworkUserCallbacks\"\n\t\t| \"interview\"\n\t\t| \"logConfig\"\n\t\t| \"preferences\"\n\t\t| \"vendor\"\n\t>\n\t& {\n\t\tuserAgent?: Record<string, string | null | undefined>;\n\t}\n>;\n\nexport const driverPresets = Object.freeze(\n\t{\n\t\t/**\n\t\t * Increases several timeouts to be able to deal with controllers\n\t\t * and/or nodes that have severe trouble communicating.\n\t\t */\n\t\tSAFE_MODE: {\n\t\t\ttimeouts: {\n\t\t\t\t// 500 series controllers that take long to respond instead of delaying the callback\n\t\t\t\tresponse: 60000,\n\t\t\t\t// Any controller having trouble reaching a node\n\t\t\t\tsendDataAbort: 60000,\n\t\t\t\tsendDataCallback: 65000,\n\t\t\t\t// Slow nodes taking long to respond\n\t\t\t\treport: 10000,\n\t\t\t\tnonce: 20000,\n\t\t\t},\n\t\t\tattempts: {\n\t\t\t\t// Increase communication attempts with nodes to their maximum\n\t\t\t\tsendData: 5,\n\t\t\t\tsendDataJammed: 10,\n\t\t\t\tnodeInterview: 10,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Disables the unresponsive controller recovery to be able to deal with controllers\n\t\t * that frequently become unresponsive for seemingly no reason.\n\t\t */\n\t\tNO_CONTROLLER_RECOVERY: {\n\t\t\tfeatures: {\n\t\t\t\tunresponsiveControllerRecovery: false,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Prevents enabling the watchdog to be able to deal with controllers\n\t\t * which frequently get restarted for seemingly no reason.\n\t\t */\n\t\tNO_WATCHDOG: {\n\t\t\tfeatures: {\n\t\t\t\twatchdog: false,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sends battery powered nodes to sleep more quickly in order to save battery.\n\t\t */\n\t\tBATTERY_SAVE: {\n\t\t\ttimeouts: {\n\t\t\t\tsendToSleep: 100,\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sends battery powered nodes to sleep less quickly to give applications\n\t\t * more time between interactions.\n\t\t */\n\t\tAWAKE_LONGER: {\n\t\t\ttimeouts: {\n\t\t\t\tsendToSleep: 1000,\n\t\t\t},\n\t\t},\n\t} as const satisfies Record<string, PartialZWaveOptions>,\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAgbA;;;;;AAAO,MAAM,gBAAgB,OAAO,OACnC;;;;;EAKC,WAAW;IACV,UAAU;;MAET,UAAU;;MAEV,eAAe;MACf,kBAAkB;;MAElB,QAAQ;MACR,OAAO;;IAER,UAAU;;MAET,UAAU;MACV,gBAAgB;MAChB,eAAe;;;;;;;EAQjB,wBAAwB;IACvB,UAAU;MACT,gCAAgC;;;;;;;EAQlC,aAAa;IACZ,UAAU;MACT,UAAU;;;;;;EAOZ,cAAc;IACb,UAAU;MACT,aAAa;;;;;;;EAQf,cAAc;IACb,UAAU;MACT,aAAa;;;CAGwC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -70,7 +70,7 @@ var import_math = require("alcalzone-shared/math");
|
|
|
70
70
|
var import_typeguards = require("alcalzone-shared/typeguards");
|
|
71
71
|
var import_node_events = require("node:events");
|
|
72
72
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
73
|
-
var
|
|
73
|
+
var import_parse = __toESM(require("semver/functions/parse.js"), 1);
|
|
74
74
|
var import_Inclusion = require("../controller/Inclusion.js");
|
|
75
75
|
var import_NodeInformationFrame = require("../controller/NodeInformationFrame.js");
|
|
76
76
|
var import_Driver = require("../driver/Driver.js");
|
|
@@ -1965,7 +1965,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1965
1965
|
// Supervision as it shouldn't be used for Get-Report flows
|
|
1966
1966
|
encapsulationFlags: command.encapsulationFlags & ~import_core.EncapsulationFlags.Supervision
|
|
1967
1967
|
});
|
|
1968
|
-
const firmwareVersion1 =
|
|
1968
|
+
const firmwareVersion1 = (0, import_parse.default)(import_Driver.libVersion, { loose: true });
|
|
1969
1969
|
await api.sendReport({
|
|
1970
1970
|
libraryType: import_core.ZWaveLibraryTypes["Static Controller"],
|
|
1971
1971
|
protocolVersion: this.driver.controller.protocolVersion,
|