From 69e702ed0cec02185ae44b261623849da36b246a Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 4 Dec 2019 09:24:34 +0100 Subject: [PATCH] Let switch.wemo on/off/toggle methods always call status() for returned value for consistency with the frontend and other switch plugins --- platypush/plugins/switch/wemo/__init__.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/platypush/plugins/switch/wemo/__init__.py b/platypush/plugins/switch/wemo/__init__.py index 9eb8b2e57b..c3f1646632 100644 --- a/platypush/plugins/switch/wemo/__init__.py +++ b/platypush/plugins/switch/wemo/__init__.py @@ -126,11 +126,8 @@ class SwitchWemoPlugin(SwitchPlugin): :param device: Device name or address """ - state = self._exec(device=device, action=SwitchAction.SET_STATE, value=1) - return { - 'device': device, - 'on': bool(int(state)), - } + self._exec(device=device, action=SwitchAction.SET_STATE, value=1) + return self.status(device) @action def off(self, device: str, **kwargs): @@ -139,11 +136,8 @@ class SwitchWemoPlugin(SwitchPlugin): :param device: Device name or address """ - state = self._exec(device=device, action=SwitchAction.SET_STATE, value=0) - return { - 'device': device, - 'on': bool(int(state)), - } + self._exec(device=device, action=SwitchAction.SET_STATE, value=0) + return self.status(device) @action def toggle(self, device: str, *args, **kwargs):