mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Fix bug related to maker_param types
This commit is contained in:
parent
0de9229d75
commit
7ad5b3a17b
@ -97,22 +97,21 @@ class WemoSwitch(SwitchDevice):
|
|||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
attr = super().state_attributes or {}
|
attr = super().state_attributes or {}
|
||||||
|
|
||||||
if self.maker_params:
|
if self.maker_params:
|
||||||
# Is the maker sensor on or off.
|
# Is the maker sensor on or off.
|
||||||
|
if self.entity_id == 'switch.hi_fi_systemline_sensor':
|
||||||
if self.maker_params['hassensor']:
|
if self.maker_params['hassensor']:
|
||||||
# Note a state of 1 matches the WeMo app 'not triggered'!
|
# 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
|
attr[ATTR_SENSOR_STATE] = STATE_OFF
|
||||||
else:
|
else:
|
||||||
attr[ATTR_SENSOR_STATE] = STATE_ON
|
attr[ATTR_SENSOR_STATE] = STATE_ON
|
||||||
|
|
||||||
# Is the maker switch configured as toggle(0) or momentary (1).
|
# Is the maker switch configured as toggle(0) or momentary (1).
|
||||||
if self.maker_params['switchmode']:
|
if self.maker_params['switchmode']:
|
||||||
if self.maker_params['switchmode'] == '1':
|
attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_MOMENTARY
|
||||||
attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_MOMENTARY
|
else:
|
||||||
else:
|
attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_TOGGLE
|
||||||
attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_TOGGLE
|
|
||||||
|
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user