We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b732174 commit b4c3de3Copy full SHA for b4c3de3
homeassistant/components/switch/tplink.py
@@ -66,7 +66,7 @@ def name(self):
66
@property
67
def is_on(self):
68
"""Return true if switch is on."""
69
- return self.smartplug.is_on
+ return self._state
70
71
def turn_on(self, **kwargs):
72
"""Turn the switch on."""
@@ -84,7 +84,8 @@ def device_state_attributes(self):
84
def update(self):
85
"""Update the TP-Link switch's state."""
86
try:
87
- self._state = self.smartplug.state
+ self._state = self.smartplug.state == \
88
+ self.smartplug.SWITCH_STATE_ON
89
90
if self.smartplug.has_emeter:
91
emeter_readings = self.smartplug.get_emeter_realtime()
0 commit comments