Comments (2)
Here's a mock config file to test. This automatically sends random door state notifications every 5 seconds:
// @ts-check
const { NotificationCCReport } = require("@zwave-js/cc/NotificationCC");
const { CommandClasses } = require("@zwave-js/core");
const { ccCaps, createMockZWaveRequestFrame } = require("@zwave-js/testing");
let simulationTimer;
process.on("SIGINT", () => {
if (simulationTimer) clearInterval(simulationTimer);
});
/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */
module.exports.default = {
nodes: [
{
id: 2,
capabilities: {
commandClasses: [
CommandClasses.Version,
ccCaps({
ccId: CommandClasses.Notification,
isSupported: true,
version: 11,
notificationTypesAndEvents: {
// Access Control - Door state
[0x06]: [0x16, 0x17],
},
}),
],
},
behaviors: [
{
// Small hack - start the state simulation timer when the node
// receives a command from the controller
async onControllerFrame(controller, self, _frame) {
if (!simulationTimer) {
// Then send notifications regularly
simulationTimer = setInterval(() => {
// 75% of reports are open, 25% are closed
const isOpen = Math.random() < 0.75;
// 50% of reports include the tilt parameter
const supportsTilt = Math.random() < 0.5;
// 50% of those are tilted, 50% are not
const isTilted = Math.random() < 0.5;
const cc = new NotificationCCReport(self.host, {
nodeId: controller.host.ownNodeId,
notificationType: 0x06, // Access Control
notificationEvent: isOpen ? 0x16 : 0x17,
eventParameters: isOpen && supportsTilt
? Buffer.from([
isTilted ? 0x01 : 0x00,
])
: undefined,
});
self.sendToController(
createMockZWaveRequestFrame(cc, {
ackRequested: false,
}),
);
// Tune this value according to how often you want to get notifications
}, 5000).unref();
}
return false;
},
},
],
},
],
};
from certification-backlog.
Related Issues (20)
- PIN dialog can be closed accidentally, preventing inclusion
- Add/Edit SmartStart provisioning list HOT 2
- Fix service call for setting a config value HOT 8
- Z-Wave JS: Controller hard reset needs to be exposed HOT 1
- No support for Entry Control CC (such as an alarm keypad) HOT 1
- Add support for Thermostat Setback CC
- Z-Wave JS: Certification requirements for Sound Switch CC not fulfilled HOT 1
- Z-Wave JS: Certification requirements for Meter CC not fulfilled HOT 9
- Functionality to stop a color/dim transition HOT 1
- Add support for a non-dimmable color light HOT 2
- Visualize Central Scenes HOT 2
- Implement missing functionality for Door Locks HOT 7
- Color Switch CC: Improve inspecting the current state
- Z-Wave JS: Notification variables are disabled by default, certification expects received notifications to be shown HOT 5
- User Code CC support HOT 3
- Multilevel Sensor CC: Wrong unit shown when a report with an unknown scale is used HOT 7
- Add button entity to reset Meter CC
- Treat Basic CC `currentValue` without `targetValue` as a numeric (?) sensor instead of a light HOT 6
- Fibaro FGFS101 Creates Basic Switch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from certification-backlog.