forked from platypush/platypush
Let switch.wemo on/off/toggle methods always call status() for returned value for consistency with the frontend and other switch plugins
This commit is contained in:
parent
675b690929
commit
69e702ed0c
1 changed files with 4 additions and 10 deletions
|
@ -126,11 +126,8 @@ class SwitchWemoPlugin(SwitchPlugin):
|
||||||
|
|
||||||
:param device: Device name or address
|
:param device: Device name or address
|
||||||
"""
|
"""
|
||||||
state = self._exec(device=device, action=SwitchAction.SET_STATE, value=1)
|
self._exec(device=device, action=SwitchAction.SET_STATE, value=1)
|
||||||
return {
|
return self.status(device)
|
||||||
'device': device,
|
|
||||||
'on': bool(int(state)),
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def off(self, device: str, **kwargs):
|
def off(self, device: str, **kwargs):
|
||||||
|
@ -139,11 +136,8 @@ class SwitchWemoPlugin(SwitchPlugin):
|
||||||
|
|
||||||
:param device: Device name or address
|
:param device: Device name or address
|
||||||
"""
|
"""
|
||||||
state = self._exec(device=device, action=SwitchAction.SET_STATE, value=0)
|
self._exec(device=device, action=SwitchAction.SET_STATE, value=0)
|
||||||
return {
|
return self.status(device)
|
||||||
'device': device,
|
|
||||||
'on': bool(int(state)),
|
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def toggle(self, device: str, *args, **kwargs):
|
def toggle(self, device: str, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue