Fixed KeyError

This commit is contained in:
Fabio Manganiello 2019-12-04 09:32:56 +01:00
parent 10ab1751d8
commit c34c8586f4

View file

@ -129,7 +129,7 @@ class SwitchWemoPlugin(SwitchPlugin):
:param device: Device name or address
"""
self._exec(device=device, action=SwitchAction.SET_STATE, value=1)
return self.status(device).output[0]
return self.status(device)
@action
def off(self, device: str, **kwargs):
@ -139,7 +139,7 @@ class SwitchWemoPlugin(SwitchPlugin):
:param device: Device name or address
"""
self._exec(device=device, action=SwitchAction.SET_STATE, value=0)
return self.status(device).output[0]
return self.status(device)
@action
def toggle(self, device: str, *args, **kwargs):