From 7ad5b3a17b02ca96f8872ee3470845082dae0b9c Mon Sep 17 00:00:00 2001 From: pavoni Date: Wed, 20 Jan 2016 19:13:29 +0000 Subject: [PATCH] Fix bug related to maker_param types --- homeassistant/components/switch/wemo.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py index b44a21279ba..72631244ea1 100644 --- a/homeassistant/components/switch/wemo.py +++ b/homeassistant/components/switch/wemo.py @@ -97,22 +97,21 @@ class WemoSwitch(SwitchDevice): @property def state_attributes(self): attr = super().state_attributes or {} - if self.maker_params: # Is the maker sensor on or off. + if self.entity_id == 'switch.hi_fi_systemline_sensor': if self.maker_params['hassensor']: # Note a state of 1 matches the WeMo app 'not triggered'! - if self.maker_params['sensorstate'] == '1': + if self.maker_params['sensorstate']: attr[ATTR_SENSOR_STATE] = STATE_OFF else: attr[ATTR_SENSOR_STATE] = STATE_ON # Is the maker switch configured as toggle(0) or momentary (1). if self.maker_params['switchmode']: - if self.maker_params['switchmode'] == '1': - attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_MOMENTARY - else: - attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_TOGGLE + attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_MOMENTARY + else: + attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_TOGGLE return attr