Restore status attribute for xiaomi_vacuum (#16366)

* Added new states and exposed state/state code received from xiaomi vacuum

* Restore status attribute for xiaomi_vacuum
This commit is contained in:
Varga Tamas 2018-09-08 18:13:24 +02:00 committed by Martin Hjelmare
parent 8a2bc99f63
commit 93143384a8

View File

@ -60,6 +60,7 @@ ATTR_ERROR = 'error'
ATTR_RC_DURATION = 'duration' ATTR_RC_DURATION = 'duration'
ATTR_RC_ROTATION = 'rotation' ATTR_RC_ROTATION = 'rotation'
ATTR_RC_VELOCITY = 'velocity' ATTR_RC_VELOCITY = 'velocity'
ATTR_STATUS = 'status'
SERVICE_SCHEMA_REMOTE_CONTROL = VACUUM_SERVICE_SCHEMA.extend({ SERVICE_SCHEMA_REMOTE_CONTROL = VACUUM_SERVICE_SCHEMA.extend({
vol.Optional(ATTR_RC_VELOCITY): vol.Optional(ATTR_RC_VELOCITY):
@ -240,7 +241,8 @@ class MiroboVacuum(StateVacuumDevice):
/ 3600), / 3600),
ATTR_SENSOR_DIRTY_LEFT: int( ATTR_SENSOR_DIRTY_LEFT: int(
self.consumable_state.sensor_dirty_left.total_seconds() self.consumable_state.sensor_dirty_left.total_seconds()
/ 3600) / 3600),
ATTR_STATUS: str(self.vacuum_state.state)
}) })
if self.vacuum_state.got_error: if self.vacuum_state.got_error: