Skip to content

Commit

Permalink
Merge branch 'master' into pr/apella12/6336
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Oct 11, 2023
2 parents 3ce912c + 8fcdc40 commit ed5592b
Show file tree
Hide file tree
Showing 1,114 changed files with 12,192 additions and 15,208 deletions.
42 changes: 41 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,54 @@
<!--
Add placeholder for next release with `wip` snippet
-->
## 12.0.4 (2023-10-09)
### Bugfixes
* Normalize result of `Controller.getAvailableFirmwareUpdates` to always include `channel` field (#6359)
* Fixed a crash that could happen while logging dropped sensor readings (#6379)
* Increased the range and default of the `response` timeout to accomodate slower 500 series controllers (#6378)

### Config file changes
* Treat Basic Set as events for TKB TZ35S/D and TZ55S/D (#6381)
* Add Zooz ZAC38 Range Extender (#6136)
* Corrected the label of the notification event `0x0a` to be `Emergency Alarm` (#6368)

## 12.0.3 (2023-10-05)
The `v12` release was supposed to increase reliability of Z-Wave JS, primarily by detecting situations where the controller was unable to transmit due to excessive RF noise or being unresponsive and automatically taking the necessary steps to recover.

Instead, it uncovered bugs and erratical behavior in the 500 series firmwares, which triggered the automatic recovery in situations where it was not necessary. In the worst case, this would cause Z-Wave JS to end up in an infinite loop or restart over and over.

This patch should fix and/or work around most (if not all) of these issues. Really sorry for the inconvenience!

### Bugfixes
* Fixed an infinite loop caused by assuming the controller was temporarily unable to transmit when when sending a command results in the transmit status `Fail` (#6361)
* Added a workaround to avoid a restart loop caused by 500 series controllers replying with invalid commands when assigning routes back to the controller (SUC) failed (#6370, #6372)
* Automatically recovering an unresponsive controller by restarting it or Z-Wave JS in case of a missing callback is now only done for `SendData` commands. Previously some commands which were expecting a specific command to be received from a node could also trigger this, even if that command was not technically a command callback. (#6373)
* Fixed an issue where rebuilding routes would throw an error because of calling the wrong method internally (#6362)

## 12.0.2 (2023-09-29)
### Bugfixes
* The workaround from `v12.0.0` for the `7.19.x` SDK bug was not working correctly when the command that caused the controller to get stuck could be retried. This has now been fixed. (#6343)

## 12.0.1 (2023-09-29)
### Bugfixes
* Ignore when a node reports `Security S0/S2 CC` to have version 0 (unsupported) although it is using that CC (#6333)

### Config file changes
* Add Shelly to manufacturers (#6339)
* Add Shelly Wave 1, Wave 2PM, update Wave 1PM association labels (#6326)
* Add Sunricher SR-ZV2833PAC (#6310)

### Changes under the hood
* Added an ESLint rule to help with deciding whether a config parameter needs to be `unsigned` or not (#6325, #6338)

## 12.0.0 (2023-09-26)
### Application compatibility
Home Assistant users who manage `zwave-js-server` themselves, **must** install the following upgrades before upgrading to this driver version:
* Home Assistant **2023.10.0** or higher
* `zwave-js-server` **1.32.0**

### Breaking changes · [Migration guide](https://zwave-js.github.io/node-zwave-js/#/getting-started/migrating-to-v12)
* Removed auto-disabling of soft-reset capability. If Z-Wave JS is no longer able to communicate with the controller after updating, please read [this issue](https://github.com/zwave-js/node-zwave-js/issues/6341) (#6256)
* Remove support for Node.js 14 and 16 (#6245)
* Subpath exports are now exposed using the `exports` field in `package.json` instead of `typesVersions` (#5839)
* The `"notification"` event now includes a reference to the endpoint that sent the notification (#6083)
Expand All @@ -27,7 +68,6 @@ Home Assistant users who manage `zwave-js-server` themselves, **must** install t

### Bugfixes
* A bug in the `7.19.x` SDK has surfaced where the controller gets stuck in the middle of a transmission. Previously this would go unnoticed because the failed commands would cause the nodes to be marked dead until the controller finally recovered. Since `v11.12.0` however, Z-Wave JS would consider the controller jammed and retry the last command indefinitely. This situation is now detected and Z-Wave JS attempts to recover by soft-resetting the controller when this happens. (#6296)
* Removed auto-disabling of soft-reset capability (#6256)
* Default to RF protection state `Unprotected` if not given for `Protection CC` V2+ (#6257)

### Config file changes
Expand Down
6 changes: 6 additions & 0 deletions docs/api/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ interface ZWaveOptions extends ZWaveHostOptions {
/** How long generated nonces are valid */
nonce: number; // [3000...20000], default: 5000 ms
/** How long to wait before retrying a command when the controller is jammed */
retryJammed: number; // [10...5000], default: 1000 ms
/**
* How long to wait without pending commands before sending a node back to sleep.
* Should be as short as possible to save battery, but long enough to give applications time to react.
Expand Down Expand Up @@ -736,6 +739,9 @@ interface ZWaveOptions extends ZWaveHostOptions {
/** How often the driver should try sending SendData commands before giving up */
sendData: number; // [1...5], default: 3
/** How often the driver should retry SendData commands while the controller is jammed */
sendDataJammed: number; // [1...10], default: 5
/**
* How many attempts should be made for each node interview before giving up
*/
Expand Down
6 changes: 6 additions & 0 deletions docs/config-files/file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ Several command classes are refreshed regularly (every couple of hours) if they

By default, received `Basic CC::Report` commands are mapped to a more appropriate CC. Setting `disableBasicMapping` to `true` disables this feature.

### `disableCallbackFunctionTypeCheck`

By default, responses or callbacks for Serial API commands must have the same function type (command identifier) in order to be recognized. However, in some situations, certain controllers send a callback with an invalid function type. In this case, the faulty commands may be listed in the `disableCallbackFunctionTypeCheck` array to disable the check for a matching function type.

> [!NOTE] This compat flag requires command-specific support and is not a generic escape hatch.
### `disableStrictEntryControlDataValidation`

The specifications mandate strict rules for the data and sequence numbers in `Entry Control CC Notifications`, which some devices do not follow, causing the notifications to get dropped. Setting `disableStrictEntryControlDataValidation` to `true` disables these strict checks.
Expand Down
11 changes: 9 additions & 2 deletions docs/development/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Click [here](https://gitpod.io/#/https://github.com/zwave-js/node-zwave-js) to s

For the best possible offline development experience, you should use [VSCode](https://code.visualstudio.com/).
The repository comes with settings and recommended extensions to make your life easier when working on `node-zwave-js`. The snippets alone will save you a ton of typing.\
It is **strongly recommended** to install the recommended extensions when VSCode asks you.
It is **strongly recommended** to install the recommended extensions when VSCode asks you to.

Since this repo uses `yarn` workspaces, you need to make sure you have `yarn` installed. If not, run `npm i -g yarn`.

Expand All @@ -41,7 +41,14 @@ to avoid downloading all these unnecessary files. The specifications can then (o
git submodule update
```

Afterwards just execute `yarn` in the cloned directory, which will install all required dependencies.
After the repository has been cloned, install all dependencies and compile the code by executing

```
yarn
yarn build
```

The last step is recommended, since we make heavy use of custom scripts and plugins meant to help with the development process and authoring config files.

---

Expand Down
8 changes: 8 additions & 0 deletions maintenance/schemas/device-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@
"disableBasicMapping": {
"const": true
},
"disableCallbackFunctionTypeCheck": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 1
},
"disableStrictEntryControlDataValidation": {
"const": true
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zwave-js/repo",
"version": "12.0.0",
"version": "12.0.4",
"private": true,
"description": "Z-Wave driver written entirely in JavaScript/TypeScript",
"keywords": [],
Expand Down Expand Up @@ -40,7 +40,7 @@
"@dprint/json": "^0.17.4",
"@dprint/markdown": "^0.16.0",
"@dprint/typescript": "^0.87.1",
"@microsoft/api-extractor": "^7.36.4",
"@microsoft/api-extractor": "^7.37.3",
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.10.2",
"@tsconfig/node18": "^18.2.1",
"@types/fs-extra": "^11.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zwave-js/cc",
"version": "12.0.0",
"version": "12.0.4",
"description": "zwave-js: Command Classes",
"keywords": [],
"publishConfig": {
Expand Down Expand Up @@ -71,7 +71,7 @@
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.36.4",
"@microsoft/api-extractor": "^7.37.3",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.17.14",
"@zwave-js/maintenance": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/cc/src/cc/MultilevelSensorCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ export class MultilevelSensorCCReport extends MultilevelSensorCC {
if (supportedSensorTypes?.length) {
validatePayload.withReason(
`Unsupported sensor type ${
sensorType!.label
applHost.configManager.getSensorTypeName(this.type)
} or corrupted data`,
)(supportedSensorTypes.includes(this.type));
}
Expand Down
2 changes: 2 additions & 0 deletions packages/config/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export class ConditionalCompatConfig implements ConditionalItem<CompatConfig> {
// (undocumented)
readonly disableBasicMapping?: boolean;
// (undocumented)
readonly disableCallbackFunctionTypeCheck?: number[];
// (undocumented)
readonly disableStrictEntryControlDataValidation?: boolean;
// (undocumented)
readonly disableStrictMeasurementValidation?: boolean;
Expand Down
5 changes: 1 addition & 4 deletions packages/config/config/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ module.exports = {
plugins: [
"@zwave-js",
],
rules: {
"@zwave-js/consistent-device-config-property-order": "error",
"@zwave-js/no-unnecessary-min-max-value": "error"
}
extends: "plugin:@zwave-js/config-files"
};
4 changes: 4 additions & 0 deletions packages/config/config/devices/0x0000/husbzb-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"firmwareVersion": {
"min": "0.0",
"max": "255.255"
},
"compat": {
// Workaround for a firmware bug in 500 series controllers
"$import": "~/templates/master_template.json#500_series_controller_compat_flags"
}
}
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0000/ps9ep.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Sigma Designs (Former Zensys)",
"manufacturerId": "0x0000",
"label": "PS9EP",
"description": "Z-wave 9 channel_module",
"description": "Z-Wave 9 Channel_module",
"devices": [
{
"productType": "0x0003",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0000/sm-pz701u.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Sigma Designs (Former Zensys)",
"manufacturerId": "0x0000",
"label": "SM-PZ701U",
"description": "Z-Wave power plug",
"description": "Z-Wave Power Plug",
"devices": [
{
"productType": "0x0003",
Expand Down
12 changes: 6 additions & 6 deletions packages/config/config/devices/0x0000/yrl220.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"#": "2",
"label": "Auto Re-lock",
"label": "Auto Re-Lock",
"description": "When enabled, the unit will automatically re-lock",
"valueSize": 1,
"defaultValue": 0,
Expand All @@ -65,10 +65,10 @@
},
{
"#": "3",
"label": "Re-lock Time",
"label": "Re-Lock Time",
"description": "Time after unlocking that the device will lock",
"valueSize": 1,
"unit": "Seconds",
"unit": "seconds",
"minValue": 5,
"maxValue": 255,
"defaultValue": 30,
Expand Down Expand Up @@ -110,7 +110,7 @@
"label": "Shutdown Time",
"description": "Number of times the device is locked out after the invalid retries are exceeded",
"valueSize": 1,
"unit": "Seconds",
"unit": "seconds",
"minValue": 1,
"maxValue": 255,
"defaultValue": 30,
Expand All @@ -129,11 +129,11 @@
"value": 0
},
{
"label": "Vacation Mode",
"label": "Vacation mode",
"value": 1
},
{
"label": "Privacy Mode",
"label": "Privacy mode",
"value": 2
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0001/zrm230.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "HomePro",
"manufacturerId": "0x0001",
"label": "ZRM230",
"description": "Wall Switch/Transmitter (2-gang)",
"description": "Wall Switch/Transmitter (2-Gang)",
"devices": [
{
"productType": "0x524d",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0002/014g0210.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
{
"#": "3",
"label": "PWM period",
"label": "PWM Period",
"description": "Pulse-width modulation period",
"valueSize": 1,
"defaultValue": 2,
Expand Down
Loading

0 comments on commit ed5592b

Please sign in to comment.