Skip to content

Commit

Permalink
Moving DMX from relays to dimmers. Adding feedback from US
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Lydersen committed Apr 15, 2020
1 parent eee7e2f commit ff8e57b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,8 @@
},
"0.2.6": {
"en": "Adding even more DMX devices"
},
"0.2.7": {
"en": "Moving DMX devices from relays to dimmers. Adding US feedback on bus"
}
}
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@
]
}
]
}
}
15 changes: 15 additions & 0 deletions drivers/universal-switch/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ class HdlUniversalSwitchDevice extends Homey.Device {
this.setCapabilityValue("onoff", status).catch(this.error);
}

respondToSender(sender) {
this._controller().send(
{
target: `${sender.subnet}.${sender.id}`,
command: 0xE01D,
data: { switch: this.getData().switch, status: this.getCapabilityValue("onoff") }
},
function(err) {
if (err) {
Homey.app.log(err);
}
}
);
}

requestUpdate() {
this._controller().send(
{
Expand Down
10 changes: 9 additions & 1 deletion drivers/universal-switch/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ class HdlUniversalSwitchDriver extends Homey.Driver {
parseInt(Homey.ManagerSettings.get("hdl_universal_motion"))
)
return;
this.log(signal.data.switch);
// RETURN IF THE SIGNAL IS FROM MYSELF
if (
signal.sender.id ==
parseInt(Homey.ManagerSettings.get("hdl_id"))
)
return;
let hdl_subnet = Homey.ManagerSettings.get("hdl_subnet");
let homeyDevice = this.getDevice({
id: `${hdl_subnet}.${signal.data.switch}`,
Expand All @@ -26,6 +31,9 @@ class HdlUniversalSwitchDriver extends Homey.Driver {
homeyDevice
.setCapabilityValue("onoff", signal.data.status)
.catch(this.error);
homeyDevice
.respondToSender(signal.sender)
.catch(this.error);
}

onPairListDevices(data, callback) {
Expand Down
11 changes: 10 additions & 1 deletion hdl/hdl_dimmers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ class HdlDimmers {
"633": { channels: 6 },
"634": { channels: 2 },
"635": { channels: 4 },
"636": { channels: 6 }
"636": { channels: 6 },
"800": { channels: 8 },
"850": { channels: 96 },
"851": { channels: 96 },
"852": { channels: 96 },
"853": { channels: 48 },
"854": { channels: 48 },
"16": { channels: 48 },
"18": { channels: 48 },
"32": { channels: 48 }
};
}
}
Expand Down
11 changes: 1 addition & 10 deletions hdl/hdl_relays.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,7 @@ class HdlRelays {
"467": { channels: 3 },
"468": { channels: 6 },
"469": { channels: 4 },
"470": { channels: 6 },
"800": { channels: 8 },
"850": { channels: 96 },
"851": { channels: 96 },
"852": { channels: 96 },
"853": { channels: 48 },
"854": { channels: 48 },
"16": { channels: 48 },
"18": { channels: 48 },
"32": { channels: 48 }
"470": { channels: 6 }
};
}
}
Expand Down

0 comments on commit ff8e57b

Please sign in to comment.