Skip to content

Commit

Permalink
Update SES302 according to latest SES303 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hankolsen committed Apr 12, 2021
1 parent 74d30ac commit 87f5e4b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
46 changes: 12 additions & 34 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@
},
"drivers": [
{
"class": "thermostat",
"class": "sensor",
"capabilities": [
"measure_battery",
"measure_temperature"
"measure_temperature",
"measure_temperature.external1",
"measure_temperature.external2",
"measure_temperature.external3",
"measure_temperature.external4"
],
"images": {
"large": "/drivers/ses302/assets/images/large.jpg",
Expand Down Expand Up @@ -96,6 +100,12 @@
"associationGroups": [
1
],
"associationGroupsMultiChannel": [
2,
3,
4,
5
],
"wakeUpInterval": 1800,
"learnmode": {
"image": "/drivers/ses302/assets/images/learnmode.jpg",
Expand All @@ -104,38 +114,6 @@
}
}
},
"multiChannelNodes": {
"2": {
"class": "sensor",
"capabilities": [
"measure_temperature"
],
"icon": "/drivers/ses302/assets/icon-multichannelnode-2.svg",
"name": {
"en": "MultiChannel device 2"
}
},
"3": {
"class": "sensor",
"capabilities": [
"measure_temperature"
],
"icon": "/drivers/ses302/assets/icon-multichannelnode-3.svg",
"name": {
"en": "MultiChannel device 3"
}
},
"4": {
"class": "sensor",
"capabilities": [
"measure_temperature"
],
"icon": "/drivers/ses302/assets/icon-multichannelnode-4.svg",
"name": {
"en": "MultiChannel device 4"
}
}
},
"settings": [
{
"id": "sensor_temperature_delta",
Expand Down
42 changes: 42 additions & 0 deletions drivers/ses302/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,55 @@ const { ZwaveDevice } = require('homey-zwavedriver');
class SES302Device extends ZwaveDevice {
async onNodeInit() {
this.log('SES302Device Init');

this.registerCapability('measure_battery', 'BATTERY');

this.registerCapability('measure_temperature', 'SENSOR_MULTILEVEL', {
getOpts: {
getOnOnline: true,
getOnStart: false,
},
});

if (this.node.MultiChannelNodes[2]) {
this.registerCapability('measure_temperature.external1', 'SENSOR_MULTILEVEL', {
multiChannelNodeId: 2,
getOpts: {
getOnOnline: true,
getOnStart: false,
},
});
}

if (this.node.MultiChannelNodes[3]) {
this.registerCapability('measure_temperature.external2', 'SENSOR_MULTILEVEL', {
multiChannelNodeId: 3,
getOpts: {
getOnOnline: true,
getOnStart: false,
},
});
}

if (this.node.MultiChannelNodes[4]) {
this.registerCapability('measure_temperature.external3', 'SENSOR_MULTILEVEL', {
multiChannelNodeId: 4,
getOpts: {
getOnOnline: true,
getOnStart: false,
},
});
}

if (this.node.MultiChannelNodes[5]) {
this.registerCapability('measure_temperature.external4', 'SENSOR_MULTILEVEL', {
multiChannelNodeId: 5,
getOpts: {
getOnOnline: true,
getOnStart: false,
},
});
}
}
}

Expand Down
34 changes: 7 additions & 27 deletions drivers/ses302/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"energy": {
"batteries": ["AA", "AA"]
},
"class": "sensor",
"zwave": {
"manufacturerId": 89,
"productTypeId": 13,
"productId": [2],
"zwaveAllianceProductId": 1240,
"zwaveAllianceProductDocumentation": "https://products.z-wavealliance.org/ProductManual/File?folder=&filename=MarketCertificationFiles/1240/SES%20302%20and%20303%20TH%20Sensors%20User%20Installation%20Manual,%20(Secure%20Controls%20UK%20Ltd)%20BGX501-923-R02.pdf",
"associationGroups": [1],
"associationGroupsMultiChannel": [2,3,4,5],
"wakeUpInterval": 1800,
"learnmode": {
"image": "{{driverAssetsPath}}/images/learnmode.jpg",
Expand All @@ -21,35 +23,13 @@
}
}
},
"multiChannelNodes": {
"2": {
"class": "sensor",
"capabilities": ["measure_temperature"],
"icon": "{{driverAssetsPath}}/icon-multichannelnode-2.svg",
"name": {
"en": "MultiChannel device 2"
}
},
"3": {
"class": "sensor",
"capabilities": ["measure_temperature"],
"icon": "{{driverAssetsPath}}/icon-multichannelnode-3.svg",
"name": {
"en": "MultiChannel device 3"
}
},
"4": {
"class": "sensor",
"capabilities": ["measure_temperature"],
"icon": "{{driverAssetsPath}}/icon-multichannelnode-4.svg",
"name": {
"en": "MultiChannel device 4"
}
}
},
"capabilities": [
"measure_battery",
"measure_temperature"
"measure_temperature",
"measure_temperature.external1",
"measure_temperature.external2",
"measure_temperature.external3",
"measure_temperature.external4"
],
"$extends": ["defaults"]
}

0 comments on commit 87f5e4b

Please sign in to comment.