diff --git a/devicetypes/copycat73/pi-hole.src/pi-hole.groovy b/devicetypes/copycat73/pi-hole.src/pi-hole.groovy index a28b1c3..e4063a5 100644 --- a/devicetypes/copycat73/pi-hole.src/pi-hole.groovy +++ b/devicetypes/copycat73/pi-hole.src/pi-hole.groovy @@ -121,10 +121,10 @@ def parse(response) { if (json.FTLnotrunning) { return } - if (json.status == "enabled") { + if (json.status == "disabled") { sendEvent(name: "switch", value: "on") } - if (json.status == "disabled") { + if (json.status == "enabled") { sendEvent(name: "switch", value: "off") } if (json.dns_queries_today.toInteger() >= 0) { @@ -137,11 +137,11 @@ def parse(response) { } def on() { - doSwitch("enable") + doSwitch("disable") } def off() { - doSwitch("disable") + doSwitch("enable") } def doSwitch(toggle) { @@ -188,4 +188,4 @@ private String convertIPtoHex(ipAddress) { private String convertPortToHex(port) { String hexport = port.toString().format( '%04x', port.toInteger() ) return hexport -} \ No newline at end of file +}