Skip to content

Commit

Permalink
Attribute load_power introduced as replacement for current. The value…
Browse files Browse the repository at this point in the history
… of the property "current" is misleading for countries with 230V mains because it was calculated with a wrong reference voltage (110V) already.
  • Loading branch information
syssi committed Sep 3, 2017
1 parent 129b412 commit d52c4a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/switch/xiaomi_plug.py
Expand Up @@ -25,11 +25,11 @@
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})

REQUIREMENTS = ['python-mirobo>=0.1.3']
REQUIREMENTS = ['python-mirobo>=0.1.5']

ATTR_POWER = 'power'
ATTR_TEMPERATURE = 'temperature'
ATTR_CURRENT = 'current'
ATTR_LOAD_POWER = 'load_power'
SUCCESS = ['ok']


Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, name, plug):
self._state = None
self._state_attrs = {
ATTR_TEMPERATURE: None,
ATTR_CURRENT: None
ATTR_LOAD_POWER: None
}
self._skip_update = False

Expand Down Expand Up @@ -156,7 +156,7 @@ def async_update(self):
self._state = state.is_on
self._state_attrs = {
ATTR_TEMPERATURE: state.temperature,
ATTR_CURRENT: state.current,
ATTR_LOAD_POWER: state.load_power,
}

except DeviceException as ex:
Expand Down

0 comments on commit d52c4a5

Please sign in to comment.