Skip to content

Commit d694da6

Browse files
authored
Make generic switch cloud DTH match LEE version (SmartThingsCommunity#2835)
* If we genericize the generic switch DTH (and make it match local execution implementation) we should be able to get the Eaton accessory dimmer to fit without any changes.
1 parent a24d422 commit d694da6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ metadata {
4040
fingerprint mfr: "001A", prod: "5244", deviceJoinName: "Eaton RF Receptacle"
4141
fingerprint mfr: "001A", prod: "534C", model: "0000", deviceJoinName: "Eaton RF Master Switch"
4242
fingerprint mfr: "001A", prod: "5354", model: "0003", deviceJoinName: "Eaton RF Appliance Plug-In Module"
43+
fingerprint mfr: "001A", prod: "5352", model: "0000", deviceJoinName: "Eaton RF Accessory Switch"
4344
}
4445

4546
// simulator metadata
@@ -105,15 +106,15 @@ def parse(String description) {
105106
}
106107

107108
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
108-
[name: "switch", value: cmd.value ? "on" : "off", type: "physical"]
109+
[name: "switch", value: cmd.value ? "on" : "off"]
109110
}
110111

111112
def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
112-
[name: "switch", value: cmd.value ? "on" : "off", type: "physical"]
113+
[name: "switch", value: cmd.value ? "on" : "off"]
113114
}
114115

115116
def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
116-
[name: "switch", value: cmd.value ? "on" : "off", type: "digital"]
117+
[name: "switch", value: cmd.value ? "on" : "off"]
117118
}
118119

119120
def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
@@ -148,15 +149,15 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
148149

149150
def on() {
150151
delayBetween([
151-
zwave.basicV1.basicSet(value: 0xFF).format(),
152-
zwave.switchBinaryV1.switchBinaryGet().format()
152+
zwave.basicV1.basicSet(value: 0xFF).format(),
153+
zwave.basicV1.basicGet().format()
153154
])
154155
}
155156

156157
def off() {
157158
delayBetween([
158-
zwave.basicV1.basicSet(value: 0x00).format(),
159-
zwave.switchBinaryV1.switchBinaryGet().format()
159+
zwave.basicV1.basicSet(value: 0x00).format(),
160+
zwave.basicV1.basicGet().format()
160161
])
161162
}
162163

@@ -173,7 +174,7 @@ def ping() {
173174

174175
def refresh() {
175176
def commands = []
176-
commands << zwave.switchBinaryV1.switchBinaryGet().format()
177+
commands << zwave.basicV1.basicGet().format()
177178
if (getDataValue("MSR") == null) {
178179
commands << zwave.manufacturerSpecificV1.manufacturerSpecificGet().format()
179180
}

0 commit comments

Comments
 (0)