mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add last clean times to xiaomi vacuum (#19043)
This commit is contained in:
parent
da0542e961
commit
bc69309b46
@ -45,6 +45,8 @@ FAN_SPEEDS = {
|
|||||||
'Turbo': 77,
|
'Turbo': 77,
|
||||||
'Max': 90}
|
'Max': 90}
|
||||||
|
|
||||||
|
ATTR_CLEAN_START = 'clean_start'
|
||||||
|
ATTR_CLEAN_STOP = 'clean_stop'
|
||||||
ATTR_CLEANING_TIME = 'cleaning_time'
|
ATTR_CLEANING_TIME = 'cleaning_time'
|
||||||
ATTR_DO_NOT_DISTURB = 'do_not_disturb'
|
ATTR_DO_NOT_DISTURB = 'do_not_disturb'
|
||||||
ATTR_DO_NOT_DISTURB_START = 'do_not_disturb_start'
|
ATTR_DO_NOT_DISTURB_START = 'do_not_disturb_start'
|
||||||
@ -169,6 +171,7 @@ class MiroboVacuum(StateVacuumDevice):
|
|||||||
self.consumable_state = None
|
self.consumable_state = None
|
||||||
self.clean_history = None
|
self.clean_history = None
|
||||||
self.dnd_state = None
|
self.dnd_state = None
|
||||||
|
self.last_clean = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -248,6 +251,10 @@ class MiroboVacuum(StateVacuumDevice):
|
|||||||
ATTR_STATUS: str(self.vacuum_state.state)
|
ATTR_STATUS: str(self.vacuum_state.state)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if self.last_clean:
|
||||||
|
attrs[ATTR_CLEAN_START] = self.last_clean.start
|
||||||
|
attrs[ATTR_CLEAN_STOP] = self.last_clean.end
|
||||||
|
|
||||||
if self.vacuum_state.got_error:
|
if self.vacuum_state.got_error:
|
||||||
attrs[ATTR_ERROR] = self.vacuum_state.error
|
attrs[ATTR_ERROR] = self.vacuum_state.error
|
||||||
return attrs
|
return attrs
|
||||||
@ -368,6 +375,7 @@ class MiroboVacuum(StateVacuumDevice):
|
|||||||
|
|
||||||
self.consumable_state = self._vacuum.consumable_status()
|
self.consumable_state = self._vacuum.consumable_status()
|
||||||
self.clean_history = self._vacuum.clean_history()
|
self.clean_history = self._vacuum.clean_history()
|
||||||
|
self.last_clean = self._vacuum.last_clean_details()
|
||||||
self.dnd_state = self._vacuum.dnd_status()
|
self.dnd_state = self._vacuum.dnd_status()
|
||||||
|
|
||||||
self._available = True
|
self._available = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user