-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zwave Mock addon: More mocks, rename files to include node ID, update…
… Z-Wave JS (#175) * add new mock files for switches, rename files to include node ID * add two more dumps * Bump zwave-js * Add mock for setback thermostat * bump zwave-js * add thermostat without overlap between modes and setpoints * bump addon version * remove duplicate mock file
- Loading branch information
Showing
11 changed files
with
7,495 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
16 changes: 6 additions & 10 deletions
16
...ck_files/thermostat-from-certification.js → ...les/003-thermostat-setpoint-no-overlap.js
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
zwave_mock_server/default_mock_files/004-binary-multilevel-color-switch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// This mock simulates a device with a Multilevel Switch, a Binary Switch, and a Color Switch command class | ||
/// The resulting entities should be a colored light and a switch. | ||
|
||
// @ts-check | ||
const { CommandClasses } = require("@zwave-js/core"); | ||
const { ccCaps } = require("@zwave-js/testing"); | ||
const { ColorComponent } = require("zwave-js"); | ||
|
||
/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */ | ||
module.exports.default = { | ||
nodes: [ | ||
{ | ||
id: 4, | ||
capabilities: { | ||
commandClasses: [ | ||
CommandClasses.Version, | ||
ccCaps({ | ||
ccId: CommandClasses["Multilevel Switch"], | ||
isSupported: true, | ||
version: 4, | ||
}), | ||
ccCaps({ | ||
ccId: CommandClasses["Binary Switch"], | ||
isSupported: true, | ||
version: 2, | ||
}), | ||
ccCaps({ | ||
ccId: CommandClasses["Color Switch"], | ||
isSupported: true, | ||
version: 3, | ||
colorComponents: { | ||
[ColorComponent.Red]: 0, | ||
[ColorComponent.Green]: 0, | ||
[ColorComponent.Blue]: 0, | ||
}, | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// This mock simulates a device with just a Binary Switch | ||
|
||
// @ts-check | ||
const { CommandClasses } = require("@zwave-js/core"); | ||
const { ccCaps } = require("@zwave-js/testing"); | ||
const { ColorComponent } = require("zwave-js"); | ||
|
||
/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */ | ||
module.exports.default = { | ||
nodes: [ | ||
{ | ||
id: 5, | ||
capabilities: { | ||
commandClasses: [ | ||
CommandClasses.Version, | ||
ccCaps({ | ||
ccId: CommandClasses["Binary Switch"], | ||
isSupported: true, | ||
version: 2, | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
25 changes: 25 additions & 0 deletions
25
zwave_mock_server/default_mock_files/006-multilevel-switch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// This mock simulates a device with just a Multilevel Switch | ||
|
||
// @ts-check | ||
const { CommandClasses } = require("@zwave-js/core"); | ||
const { ccCaps } = require("@zwave-js/testing"); | ||
const { ColorComponent } = require("zwave-js"); | ||
|
||
/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */ | ||
module.exports.default = { | ||
nodes: [ | ||
{ | ||
id: 6, | ||
capabilities: { | ||
commandClasses: [ | ||
CommandClasses.Version, | ||
ccCaps({ | ||
ccId: CommandClasses["Multilevel Switch"], | ||
isSupported: true, | ||
version: 4, | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
41 changes: 41 additions & 0 deletions
41
zwave_mock_server/default_mock_files/007-binary-color-switch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// This mock simulates a device with a Binary Switch, and a Color Switch CC. | ||
/// The resulting entity should support on/off and dimming by reducing the color intensity. | ||
|
||
// @ts-check | ||
const { CommandClasses } = require("@zwave-js/core"); | ||
const { ccCaps } = require("@zwave-js/testing"); | ||
const { ColorComponent } = require("zwave-js"); | ||
|
||
/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */ | ||
module.exports.default = { | ||
nodes: [ | ||
{ | ||
id: 7, | ||
capabilities: { | ||
commandClasses: [ | ||
CommandClasses.Version, | ||
ccCaps({ | ||
ccId: CommandClasses["Multilevel Switch"], | ||
isSupported: true, | ||
version: 4, | ||
}), | ||
ccCaps({ | ||
ccId: CommandClasses["Binary Switch"], | ||
isSupported: true, | ||
version: 2, | ||
}), | ||
ccCaps({ | ||
ccId: CommandClasses["Color Switch"], | ||
isSupported: true, | ||
version: 3, | ||
colorComponents: { | ||
[ColorComponent.Red]: 0, | ||
[ColorComponent.Green]: 0, | ||
[ColorComponent.Blue]: 0, | ||
}, | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.