Skip to content

Commit

Permalink
ZWaveJS UI - Add selector when converting Zwave device to Gladys devi…
Browse files Browse the repository at this point in the history
…ce (#2030)
  • Loading branch information
William-De71 authored Feb 23, 2024
1 parent 3a3d166 commit 185fe8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/services/zwavejs-ui/utils/convertToGladysDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const convertToGladysDevice = (serviceId, device) => {
...exposeFound,
name: value.id,
external_id: getDeviceFeatureId(device.id, commandClassName, endpoint, propertyName, propertyKeyName),
selector: getDeviceFeatureId(device.id, commandClassName, endpoint, propertyName, propertyKeyName),
node_id: device.id,
// These are custom properties only available on the object in memory (not in DB)
command_class_version: commandClassVersion,
Expand All @@ -55,6 +56,7 @@ const convertToGladysDevice = (serviceId, device) => {
return {
name: device.name,
external_id: `zwavejs-ui:${device.id}`,
selector: `zwavejs-ui:${device.id}`,
service_id: serviceId,
should_poll: false,
features,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('zwaveJSUIHandler.onNewDeviceDiscover.js', () => {
{
name: 'capteur-ouverture',
external_id: 'zwavejs-ui:2',
selector: `zwavejs-ui:2`,
service_id: 'ffa13430-df93-488a-9733-5c540e9558e0',
should_poll: false,
features: [
Expand All @@ -51,6 +52,7 @@ describe('zwaveJSUIHandler.onNewDeviceDiscover.js', () => {
command_class_version: 5,
endpoint: 0,
external_id: 'zwavejs-ui:2:0:notification:access_control:door_state_simple',
selector: 'zwavejs-ui:2:0:notification:access_control:door_state_simple',
node_id: 2,
property_name: 'Access Control',
property_key_name: 'Door state (simple)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe('zwaveJSUIHandler.setValue', () => {
{
name: 'prise01-wp',
external_id: 'zwavejs-ui:3',
selector: 'zwavejs-ui:3',
service_id: 'ee03cc7e-8551-4774-bd47-ca7565f6665d',
should_poll: false,
features: [
Expand All @@ -148,6 +149,7 @@ describe('zwaveJSUIHandler.setValue', () => {
has_feedback: true,
name: '3-37-0-currentValue',
external_id: 'zwavejs-ui:3:0:binary_switch:currentvalue',
selector: 'zwavejs-ui:3:0:binary_switch:currentvalue',
node_id: 3,
command_class_version: 1,
command_class_name: 'Binary Switch',
Expand Down Expand Up @@ -186,6 +188,7 @@ describe('zwaveJSUIHandler.setValue', () => {
{
name: 'prise01-wp',
external_id: 'zwavejs-ui:3',
selector: 'zwavejs-ui:3',
service_id: 'ee03cc7e-8551-4774-bd47-ca7565f6665d',
should_poll: false,
features: [
Expand All @@ -199,6 +202,7 @@ describe('zwaveJSUIHandler.setValue', () => {
has_feedback: true,
name: '3-37-0-currentValue',
external_id: 'zwavejs-ui:3:0:binary_switch:currentvalue',
selector: 'zwavejs-ui:3:0:binary_switch:currentvalue',
node_id: 3,
command_class_version: 1,
command_class_name: 'Binary Switch',
Expand Down

0 comments on commit 185fe8a

Please sign in to comment.