Add icon translations to Roborock (#108508)
This commit is contained in:
parent
969ee5dd9f
commit
6a197e93aa
7 changed files with 109 additions and 31 deletions
|
@ -40,7 +40,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
RoborockBinarySensorDescription(
|
||||
key="dry_status",
|
||||
translation_key="mop_drying_status",
|
||||
icon="mdi:heat-wave",
|
||||
device_class=BinarySensorDeviceClass.RUNNING,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.status.dry_status,
|
||||
|
@ -48,7 +47,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
RoborockBinarySensorDescription(
|
||||
key="water_box_carriage_status",
|
||||
translation_key="mop_attached",
|
||||
icon="mdi:square-rounded",
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.status.water_box_carriage_status,
|
||||
|
@ -56,7 +54,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
RoborockBinarySensorDescription(
|
||||
key="water_box_status",
|
||||
translation_key="water_box_attached",
|
||||
icon="mdi:water",
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.status.water_box_status,
|
||||
|
@ -64,7 +61,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
RoborockBinarySensorDescription(
|
||||
key="water_shortage",
|
||||
translation_key="water_shortage",
|
||||
icon="mdi:water",
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.status.water_shortage_status,
|
||||
|
@ -72,7 +68,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
RoborockBinarySensorDescription(
|
||||
key="in_cleaning",
|
||||
translation_key="in_cleaning",
|
||||
icon="mdi:vacuum",
|
||||
device_class=BinarySensorDeviceClass.RUNNING,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: data.status.in_cleaning,
|
||||
|
|
|
@ -35,7 +35,6 @@ class RoborockButtonDescription(
|
|||
CONSUMABLE_BUTTON_DESCRIPTIONS = [
|
||||
RoborockButtonDescription(
|
||||
key="reset_sensor_consumable",
|
||||
icon="mdi:eye-outline",
|
||||
translation_key="reset_sensor_consumable",
|
||||
command=RoborockCommand.RESET_CONSUMABLE,
|
||||
param=["sensor_dirty_time"],
|
||||
|
@ -44,7 +43,6 @@ CONSUMABLE_BUTTON_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockButtonDescription(
|
||||
key="reset_air_filter_consumable",
|
||||
icon="mdi:air-filter",
|
||||
translation_key="reset_air_filter_consumable",
|
||||
command=RoborockCommand.RESET_CONSUMABLE,
|
||||
param=["filter_work_time"],
|
||||
|
@ -53,7 +51,6 @@ CONSUMABLE_BUTTON_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockButtonDescription(
|
||||
key="reset_side_brush_consumable",
|
||||
icon="mdi:brush",
|
||||
translation_key="reset_side_brush_consumable",
|
||||
command=RoborockCommand.RESET_CONSUMABLE,
|
||||
param=["side_brush_work_time"],
|
||||
|
@ -62,7 +59,6 @@ CONSUMABLE_BUTTON_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockButtonDescription(
|
||||
key="reset_main_brush_consumable",
|
||||
icon="mdi:brush",
|
||||
translation_key="reset_main_brush_consumable",
|
||||
command=RoborockCommand.RESET_CONSUMABLE,
|
||||
param=["main_brush_work_time"],
|
||||
|
|
109
homeassistant/components/roborock/icons.json
Normal file
109
homeassistant/components/roborock/icons.json
Normal file
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"mop_drying_status": {
|
||||
"default": "mdi:heat-wave"
|
||||
},
|
||||
"mop_attached": {
|
||||
"default": "mdi:square-rounded"
|
||||
},
|
||||
"water_box_attached": {
|
||||
"default": "mdi:water"
|
||||
},
|
||||
"water_shortage": {
|
||||
"default": "mdi:water"
|
||||
},
|
||||
"in_cleaning": {
|
||||
"default": "mdi:vacuum"
|
||||
}
|
||||
},
|
||||
"button": {
|
||||
"reset_sensor_consumable": {
|
||||
"default": "mdi:eye-outline"
|
||||
},
|
||||
"reset_air_filter_consumable": {
|
||||
"default": "mdi:air-filter"
|
||||
},
|
||||
"reset_side_brush_consumable": {
|
||||
"default": "mdi:brush"
|
||||
},
|
||||
"reset_main_brush_consumable": {
|
||||
"default": "mdi:brush"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"volume": {
|
||||
"default": "mdi:volume-source"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"main_brush_time_left": {
|
||||
"default": "mdi:brush"
|
||||
},
|
||||
"side_brush_time_left": {
|
||||
"default": "mdi:brush"
|
||||
},
|
||||
"filter_time_left": {
|
||||
"default": "mdi:air-filter"
|
||||
},
|
||||
"sensor_time_left": {
|
||||
"default": "mdi:eye-outline"
|
||||
},
|
||||
"total_cleaning_time": {
|
||||
"default": "mdi:history"
|
||||
},
|
||||
"status": {
|
||||
"default": "mdi:information-outline"
|
||||
},
|
||||
"cleaning_area": {
|
||||
"default": "mdi:texture-box"
|
||||
},
|
||||
"total_cleaning_area": {
|
||||
"default": "mdi:texture-box"
|
||||
},
|
||||
"vacuum_error": {
|
||||
"default": "mdi:alert-circle"
|
||||
},
|
||||
"last_clean_start": {
|
||||
"default": "mdi:clock-time-twelve"
|
||||
},
|
||||
"last_clean_end": {
|
||||
"default": "mdi:clock-time-twelve"
|
||||
},
|
||||
"clean_percent": {
|
||||
"default": "mdi:progress-check"
|
||||
},
|
||||
"dock_error": {
|
||||
"default": "mdi:garage-open"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"child_lock": {
|
||||
"default": "mdi:account-lock"
|
||||
},
|
||||
"status_indicator": {
|
||||
"default": "mdi:alarm-light-outline"
|
||||
},
|
||||
"dnd_switch": {
|
||||
"default": "mdi:bell-cancel"
|
||||
},
|
||||
"off_peak_switch": {
|
||||
"default": "mdi:power-plug"
|
||||
}
|
||||
},
|
||||
"time": {
|
||||
"dnd_start_time": {
|
||||
"default": "mdi:bell-cancel"
|
||||
},
|
||||
"dnd_end_time": {
|
||||
"default": "mdi:bell-ring"
|
||||
},
|
||||
"off_peak_start": {
|
||||
"default": "mdi:power-plug"
|
||||
},
|
||||
"off_peak_end": {
|
||||
"default": "mdi:power-plug-off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -44,7 +44,6 @@ NUMBER_DESCRIPTIONS: list[RoborockNumberDescription] = [
|
|||
RoborockNumberDescription(
|
||||
key="volume",
|
||||
translation_key="volume",
|
||||
icon="mdi:volume-source",
|
||||
native_min_value=0,
|
||||
native_max_value=100,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
|
|
|
@ -65,7 +65,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
key="main_brush_time_left",
|
||||
icon="mdi:brush",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
translation_key="main_brush_time_left",
|
||||
value_fn=lambda data: data.consumable.main_brush_time_left,
|
||||
|
@ -75,7 +74,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
key="side_brush_time_left",
|
||||
icon="mdi:brush",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
translation_key="side_brush_time_left",
|
||||
value_fn=lambda data: data.consumable.side_brush_time_left,
|
||||
|
@ -85,7 +83,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
key="filter_time_left",
|
||||
icon="mdi:air-filter",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
translation_key="filter_time_left",
|
||||
value_fn=lambda data: data.consumable.filter_time_left,
|
||||
|
@ -95,7 +92,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
key="sensor_time_left",
|
||||
icon="mdi:eye-outline",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
translation_key="sensor_time_left",
|
||||
value_fn=lambda data: data.consumable.sensor_time_left,
|
||||
|
@ -113,14 +109,12 @@ SENSOR_DESCRIPTIONS = [
|
|||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
key="total_cleaning_time",
|
||||
translation_key="total_cleaning_time",
|
||||
icon="mdi:history",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
value_fn=lambda data: data.clean_summary.clean_time,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
RoborockSensorDescription(
|
||||
key="status",
|
||||
icon="mdi:information-outline",
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
translation_key="status",
|
||||
value_fn=lambda data: data.status.state_name,
|
||||
|
@ -130,7 +124,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockSensorDescription(
|
||||
key="cleaning_area",
|
||||
icon="mdi:texture-box",
|
||||
translation_key="cleaning_area",
|
||||
value_fn=lambda data: data.status.square_meter_clean_area,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -138,7 +131,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockSensorDescription(
|
||||
key="total_cleaning_area",
|
||||
icon="mdi:texture-box",
|
||||
translation_key="total_cleaning_area",
|
||||
value_fn=lambda data: data.clean_summary.square_meter_clean_area,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -146,7 +138,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
),
|
||||
RoborockSensorDescription(
|
||||
key="vacuum_error",
|
||||
icon="mdi:alert-circle",
|
||||
translation_key="vacuum_error",
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
value_fn=lambda data: data.status.error_code_name,
|
||||
|
@ -165,7 +156,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
key="last_clean_start",
|
||||
translation_key="last_clean_start",
|
||||
icon="mdi:clock-time-twelve",
|
||||
value_fn=lambda data: data.last_clean_record.begin_datetime
|
||||
if data.last_clean_record is not None
|
||||
else None,
|
||||
|
@ -175,7 +165,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
RoborockSensorDescription(
|
||||
key="last_clean_end",
|
||||
translation_key="last_clean_end",
|
||||
icon="mdi:clock-time-twelve",
|
||||
value_fn=lambda data: data.last_clean_record.end_datetime
|
||||
if data.last_clean_record is not None
|
||||
else None,
|
||||
|
@ -185,7 +174,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
# Only available on some newer models
|
||||
RoborockSensorDescription(
|
||||
key="clean_percent",
|
||||
icon="mdi:progress-check",
|
||||
translation_key="clean_percent",
|
||||
value_fn=lambda data: data.status.clean_percent,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -194,7 +182,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
# Only available with more than just the basic dock
|
||||
RoborockSensorDescription(
|
||||
key="dock_error",
|
||||
icon="mdi:garage-open",
|
||||
translation_key="dock_error",
|
||||
value_fn=_dock_error_value_fn,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
|
|
@ -52,7 +52,6 @@ SWITCH_DESCRIPTIONS: list[RoborockSwitchDescription] = [
|
|||
attribute="lock_status",
|
||||
key="child_lock",
|
||||
translation_key="child_lock",
|
||||
icon="mdi:account-lock",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
RoborockSwitchDescription(
|
||||
|
@ -63,7 +62,6 @@ SWITCH_DESCRIPTIONS: list[RoborockSwitchDescription] = [
|
|||
attribute="status",
|
||||
key="status_indicator",
|
||||
translation_key="status_indicator",
|
||||
icon="mdi:alarm-light-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
RoborockSwitchDescription(
|
||||
|
@ -81,7 +79,6 @@ SWITCH_DESCRIPTIONS: list[RoborockSwitchDescription] = [
|
|||
attribute="enabled",
|
||||
key="dnd_switch",
|
||||
translation_key="dnd_switch",
|
||||
icon="mdi:bell-cancel",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
RoborockSwitchDescription(
|
||||
|
@ -99,7 +96,6 @@ SWITCH_DESCRIPTIONS: list[RoborockSwitchDescription] = [
|
|||
attribute="enabled",
|
||||
key="off_peak_switch",
|
||||
translation_key="off_peak_switch",
|
||||
icon="mdi:power-plug",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
|
|
|
@ -46,7 +46,6 @@ TIME_DESCRIPTIONS: list[RoborockTimeDescription] = [
|
|||
RoborockTimeDescription(
|
||||
key="dnd_start_time",
|
||||
translation_key="dnd_start_time",
|
||||
icon="mdi:bell-cancel",
|
||||
cache_key=CacheableAttribute.dnd_timer,
|
||||
update_value=lambda cache, desired_time: cache.update_value(
|
||||
[
|
||||
|
@ -64,7 +63,6 @@ TIME_DESCRIPTIONS: list[RoborockTimeDescription] = [
|
|||
RoborockTimeDescription(
|
||||
key="dnd_end_time",
|
||||
translation_key="dnd_end_time",
|
||||
icon="mdi:bell-ring",
|
||||
cache_key=CacheableAttribute.dnd_timer,
|
||||
update_value=lambda cache, desired_time: cache.update_value(
|
||||
[
|
||||
|
@ -82,7 +80,6 @@ TIME_DESCRIPTIONS: list[RoborockTimeDescription] = [
|
|||
RoborockTimeDescription(
|
||||
key="off_peak_start",
|
||||
translation_key="off_peak_start",
|
||||
icon="mdi:power-plug",
|
||||
cache_key=CacheableAttribute.valley_electricity_timer,
|
||||
update_value=lambda cache, desired_time: cache.update_value(
|
||||
[
|
||||
|
@ -101,7 +98,6 @@ TIME_DESCRIPTIONS: list[RoborockTimeDescription] = [
|
|||
RoborockTimeDescription(
|
||||
key="off_peak_end",
|
||||
translation_key="off_peak_end",
|
||||
icon="mdi:power-plug-off",
|
||||
cache_key=CacheableAttribute.valley_electricity_timer,
|
||||
update_value=lambda cache, desired_time: cache.update_value(
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue