From 6d162929a62757f3b9a93ba8f23a13e5f90d176d Mon Sep 17 00:00:00 2001 From: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com> Date: Mon, 10 Jan 2022 22:49:59 +0100 Subject: [PATCH] Add xiaomi_miio vacuum current cleaning cycle statistics sensor (#61098) --- homeassistant/components/xiaomi_miio/sensor.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/homeassistant/components/xiaomi_miio/sensor.py b/homeassistant/components/xiaomi_miio/sensor.py index ce51f0355e2..d6d1c8500ed 100644 --- a/homeassistant/components/xiaomi_miio/sensor.py +++ b/homeassistant/components/xiaomi_miio/sensor.py @@ -115,6 +115,8 @@ ATTR_DND_START = "start" ATTR_DND_END = "end" ATTR_LAST_CLEAN_TIME = "duration" ATTR_LAST_CLEAN_AREA = "area" +ATTR_STATUS_CLEAN_TIME = "clean_time" +ATTR_STATUS_CLEAN_AREA = "clean_area" ATTR_LAST_CLEAN_START = "start" ATTR_LAST_CLEAN_END = "end" ATTR_CLEAN_HISTORY_TOTAL_DURATION = "total_duration" @@ -446,6 +448,22 @@ VACUUM_SENSORS = { name="Last Clean Area", entity_category=EntityCategory.DIAGNOSTIC, ), + f"current_{ATTR_STATUS_CLEAN_TIME}": XiaomiMiioSensorDescription( + native_unit_of_measurement=TIME_SECONDS, + icon="mdi:timer-sand", + key=ATTR_STATUS_CLEAN_TIME, + parent_key=VacuumCoordinatorDataAttributes.status, + name="Current Clean Duration", + entity_category=EntityCategory.DIAGNOSTIC, + ), + f"current_{ATTR_LAST_CLEAN_AREA}": XiaomiMiioSensorDescription( + native_unit_of_measurement=AREA_SQUARE_METERS, + icon="mdi:texture-box", + key=ATTR_STATUS_CLEAN_AREA, + parent_key=VacuumCoordinatorDataAttributes.status, + entity_category=EntityCategory.DIAGNOSTIC, + name="Current Clean Area", + ), f"clean_history_{ATTR_CLEAN_HISTORY_TOTAL_DURATION}": XiaomiMiioSensorDescription( native_unit_of_measurement=TIME_SECONDS, icon="mdi:timer-sand",