Add xiaomi_miio vacuum current cleaning cycle statistics sensor (#61098)

pull/63866/head
Kevin Hellemun 2022-01-10 22:49:59 +01:00 committed by GitHub
parent 0ac9b62f97
commit 6d162929a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -115,6 +115,8 @@ ATTR_DND_START = "start"
ATTR_DND_END = "end" ATTR_DND_END = "end"
ATTR_LAST_CLEAN_TIME = "duration" ATTR_LAST_CLEAN_TIME = "duration"
ATTR_LAST_CLEAN_AREA = "area" 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_START = "start"
ATTR_LAST_CLEAN_END = "end" ATTR_LAST_CLEAN_END = "end"
ATTR_CLEAN_HISTORY_TOTAL_DURATION = "total_duration" ATTR_CLEAN_HISTORY_TOTAL_DURATION = "total_duration"
@ -446,6 +448,22 @@ VACUUM_SENSORS = {
name="Last Clean Area", name="Last Clean Area",
entity_category=EntityCategory.DIAGNOSTIC, 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( f"clean_history_{ATTR_CLEAN_HISTORY_TOTAL_DURATION}": XiaomiMiioSensorDescription(
native_unit_of_measurement=TIME_SECONDS, native_unit_of_measurement=TIME_SECONDS,
icon="mdi:timer-sand", icon="mdi:timer-sand",