Add sensor platform to LG ThinQ integration (#125799)

* Add sensor platform to LG ThinQ integration

* Use ActiveMode.READABLE for COOKTOP

* modify strings for using referenses

* add device_class for wind_volume

* use state's references

* Dedup

---------

Co-authored-by: jangwon.lee <jangwon.lee@lge.com>
Co-authored-by: yunseon.park <yunseon.park@lge.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
LG-ThinQ-Integration 2024-10-14 18:31:42 +09:00 committed by GitHub
parent 47312793f8
commit ec30080225
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 593 additions and 36 deletions

View file

@ -173,8 +173,8 @@
}
},
"sensor": {
"error": {
"default": "mdi:alert-circle-outline"
"odor_level": {
"default": "mdi:scent"
},
"current_temperature": {
"default": "mdi:thermometer"
@ -182,6 +182,9 @@
"temperature": {
"default": "mdi:thermometer"
},
"total_pollution_level": {
"default": "mdi:air-filter"
},
"monitoring_enabled": {
"default": "mdi:monitor-eye"
},
@ -197,6 +200,18 @@
"wind_volume_for_location": {
"default": "mdi:wind-power-outline"
},
"brightness": {
"default": "mdi:tune-vertical-variant"
},
"brightness_for_location": {
"default": "mdi:tune-vertical-variant"
},
"duration": {
"default": "mdi:tune-vertical-variant"
},
"duration_for_location": {
"default": "mdi:tune-vertical-variant"
},
"day_target_temperature": {
"default": "mdi:thermometer"
},
@ -224,6 +239,9 @@
"fresh_air_filter": {
"default": "mdi:air-filter"
},
"filter_lifetime": {
"default": "mdi:air-filter"
},
"used_time": {
"default": "mdi:air-filter"
},
@ -236,6 +254,15 @@
"personalization_mode": {
"default": "mdi:dots-circle"
},
"current_dish_washing_course": {
"default": "mdi:format-list-checks"
},
"rinse_level": {
"default": "mdi:tune-vertical-variant"
},
"softening_level": {
"default": "mdi:tune-vertical-variant"
},
"cock_state": {
"default": "mdi:air-filter"
},
@ -250,6 +277,117 @@
},
"target_temperature_for_location": {
"default": "mdi:thermometer"
},
"elapsed_day_state": {
"default": "mdi:calendar-range-outline"
},
"elapsed_day_total": {
"default": "mdi:calendar-range-outline"
},
"recipe_name": {
"default": "mdi:information-box-outline"
},
"wort_info": {
"default": "mdi:information-box-outline"
},
"yeast_info": {
"default": "mdi:information-box-outline"
},
"hop_oil_info": {
"default": "mdi:information-box-outline"
},
"flavor_info": {
"default": "mdi:information-box-outline"
},
"beer_remain": {
"default": "mdi:glass-mug-variant"
},
"battery_level": {
"default": "mdi:battery-medium"
},
"relative_to_start": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_start_for_location": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_start_wm": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_start_wm_for_location": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_stop": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_stop_for_location": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_stop_wm": {
"default": "mdi:clock-time-three-outline"
},
"relative_to_stop_wm_for_location": {
"default": "mdi:clock-time-three-outline"
},
"sleep_timer_relative_to_stop": {
"default": "mdi:bed-clock"
},
"sleep_timer_relative_to_stop_for_location": {
"default": "mdi:bed-clock"
},
"absolute_to_start": {
"default": "mdi:clock-time-three-outline"
},
"absolute_to_start_for_location": {
"default": "mdi:clock-time-three-outline"
},
"absolute_to_stop": {
"default": "mdi:clock-time-three-outline"
},
"absolute_to_stop_for_location": {
"default": "mdi:clock-time-three-outline"
},
"remain": {
"default": "mdi:timer-sand"
},
"remain_for_location": {
"default": "mdi:timer-sand"
},
"running": {
"default": "mdi:timer-play-outline"
},
"running_for_location": {
"default": "mdi:timer-play-outline"
},
"total": {
"default": "mdi:timer-play-outline"
},
"total_for_location": {
"default": "mdi:timer-play-outline"
},
"target": {
"default": "mdi:clock-time-three-outline"
},
"target_for_location": {
"default": "mdi:clock-time-three-outline"
},
"light_start": {
"default": "mdi:clock-time-three-outline"
},
"light_start_for_location": {
"default": "mdi:clock-time-three-outline"
},
"light_end": {
"default": "mdi:clock-time-three-outline"
},
"light_end_for_location": {
"default": "mdi:clock-time-three-outline"
},
"power_level": {
"default": "mdi:radiator"
},
"power_level_for_location": {
"default": "mdi:radiator"
}
}
}

View file

@ -6,7 +6,7 @@ import logging
from thinqconnect import DeviceType
from thinqconnect.devices.const import Property as ThinQProperty
from thinqconnect.integration import ActiveMode, ThinQPropertyEx
from thinqconnect.integration import ActiveMode, ThinQPropertyEx, TimerProperty
from homeassistant.components.sensor import (
SensorDeviceClass,
@ -18,6 +18,7 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
PERCENTAGE,
UnitOfTemperature,
UnitOfTime,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -26,12 +27,6 @@ from . import ThinqConfigEntry
from .coordinator import DeviceDataUpdateCoordinator
from .entity import ThinQEntity
ERROR_DESC = SensorEntityDescription(
key=ThinQPropertyEx.ERROR,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQPropertyEx.ERROR,
)
AIR_QUALITY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.PM1: SensorEntityDescription(
key=ThinQProperty.PM1,
@ -64,11 +59,40 @@ AIR_QUALITY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
),
ThinQProperty.TEMPERATURE: SensorEntityDescription(
key=ThinQProperty.TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key=ThinQProperty.TEMPERATURE,
),
ThinQProperty.ODOR_LEVEL: SensorEntityDescription(
key=ThinQProperty.ODOR_LEVEL,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.ODOR_LEVEL,
),
ThinQProperty.TOTAL_POLLUTION_LEVEL: SensorEntityDescription(
key=ThinQProperty.TOTAL_POLLUTION_LEVEL,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.TOTAL_POLLUTION_LEVEL,
),
}
BATTERY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.BATTERY_PERCENT: SensorEntityDescription(
key=ThinQProperty.BATTERY_PERCENT,
translation_key=ThinQProperty.BATTERY_LEVEL,
),
}
DISH_WASHING_COURSE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.CURRENT_DISH_WASHING_COURSE: SensorEntityDescription(
key=ThinQProperty.CURRENT_DISH_WASHING_COURSE,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.CURRENT_DISH_WASHING_COURSE,
)
}
FILTER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.FILTER_LIFETIME: SensorEntityDescription(
key=ThinQProperty.FILTER_LIFETIME,
native_unit_of_measurement=UnitOfTime.HOURS,
translation_key=ThinQProperty.FILTER_LIFETIME,
),
}
HUMIDITY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.CURRENT_HUMIDITY: SensorEntityDescription(
@ -95,6 +119,65 @@ JOB_MODE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
translation_key=ThinQProperty.PERSONALIZATION_MODE,
),
}
LIGHT_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.BRIGHTNESS: SensorEntityDescription(
key=ThinQProperty.BRIGHTNESS,
translation_key=ThinQProperty.BRIGHTNESS,
),
ThinQProperty.DURATION: SensorEntityDescription(
key=ThinQProperty.DURATION,
native_unit_of_measurement=UnitOfTime.HOURS,
translation_key=ThinQProperty.DURATION,
),
}
POWER_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.POWER_LEVEL: SensorEntityDescription(
key=ThinQProperty.POWER_LEVEL,
translation_key=ThinQProperty.POWER_LEVEL,
)
}
PREFERENCE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.RINSE_LEVEL: SensorEntityDescription(
key=ThinQProperty.RINSE_LEVEL,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.RINSE_LEVEL,
),
ThinQProperty.SOFTENING_LEVEL: SensorEntityDescription(
key=ThinQProperty.SOFTENING_LEVEL,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.SOFTENING_LEVEL,
),
}
RECIPE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.RECIPE_NAME: SensorEntityDescription(
key=ThinQProperty.RECIPE_NAME,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.RECIPE_NAME,
),
ThinQProperty.WORT_INFO: SensorEntityDescription(
key=ThinQProperty.WORT_INFO,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.WORT_INFO,
),
ThinQProperty.YEAST_INFO: SensorEntityDescription(
key=ThinQProperty.YEAST_INFO,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.YEAST_INFO,
),
ThinQProperty.HOP_OIL_INFO: SensorEntityDescription(
key=ThinQProperty.HOP_OIL_INFO,
translation_key=ThinQProperty.HOP_OIL_INFO,
),
ThinQProperty.FLAVOR_INFO: SensorEntityDescription(
key=ThinQProperty.FLAVOR_INFO,
translation_key=ThinQProperty.FLAVOR_INFO,
),
ThinQProperty.BEER_REMAIN: SensorEntityDescription(
key=ThinQProperty.BEER_REMAIN,
native_unit_of_measurement=PERCENTAGE,
translation_key=ThinQProperty.BEER_REMAIN,
),
}
REFRIGERATION_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.FRESH_AIR_FILTER: SensorEntityDescription(
key=ThinQProperty.FRESH_AIR_FILTER,
@ -132,20 +215,17 @@ RUN_STATE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
TEMPERATURE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.TARGET_TEMPERATURE: SensorEntityDescription(
key=ThinQProperty.TARGET_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
translation_key=ThinQProperty.TARGET_TEMPERATURE,
),
ThinQProperty.DAY_TARGET_TEMPERATURE: SensorEntityDescription(
key=ThinQProperty.DAY_TARGET_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key=ThinQProperty.DAY_TARGET_TEMPERATURE,
),
ThinQProperty.NIGHT_TARGET_TEMPERATURE: SensorEntityDescription(
key=ThinQProperty.NIGHT_TARGET_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
translation_key=ThinQProperty.NIGHT_TARGET_TEMPERATURE,
@ -162,16 +242,90 @@ TEMPERATURE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
translation_key=ThinQProperty.CURRENT_TEMPERATURE,
),
}
WATER_FILTER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.USED_TIME: SensorEntityDescription(
key=ThinQProperty.USED_TIME,
native_unit_of_measurement=UnitOfTime.MONTHS,
translation_key=ThinQProperty.USED_TIME,
),
}
WATER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
ThinQProperty.WATER_TYPE: SensorEntityDescription(
key=ThinQProperty.WATER_TYPE,
device_class=SensorDeviceClass.ENUM,
translation_key=ThinQProperty.WATER_TYPE,
),
}
TIMER_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
TimerProperty.RELATIVE_TO_START: SensorEntityDescription(
key=TimerProperty.RELATIVE_TO_START,
translation_key=TimerProperty.RELATIVE_TO_START,
),
TimerProperty.RELATIVE_TO_START_WM: SensorEntityDescription(
key=TimerProperty.RELATIVE_TO_START,
translation_key=TimerProperty.RELATIVE_TO_START_WM,
),
TimerProperty.RELATIVE_TO_STOP: SensorEntityDescription(
key=TimerProperty.RELATIVE_TO_STOP,
translation_key=TimerProperty.RELATIVE_TO_STOP,
),
TimerProperty.RELATIVE_TO_STOP_WM: SensorEntityDescription(
key=TimerProperty.RELATIVE_TO_STOP,
translation_key=TimerProperty.RELATIVE_TO_STOP_WM,
),
TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP: SensorEntityDescription(
key=TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP,
translation_key=TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP,
),
TimerProperty.ABSOLUTE_TO_START: SensorEntityDescription(
key=TimerProperty.ABSOLUTE_TO_START,
translation_key=TimerProperty.ABSOLUTE_TO_START,
),
TimerProperty.ABSOLUTE_TO_STOP: SensorEntityDescription(
key=TimerProperty.ABSOLUTE_TO_STOP,
translation_key=TimerProperty.ABSOLUTE_TO_STOP,
),
TimerProperty.REMAIN: SensorEntityDescription(
key=TimerProperty.REMAIN,
translation_key=TimerProperty.REMAIN,
),
TimerProperty.TARGET: SensorEntityDescription(
key=TimerProperty.TARGET,
translation_key=TimerProperty.TARGET,
),
TimerProperty.RUNNING: SensorEntityDescription(
key=TimerProperty.RUNNING,
translation_key=TimerProperty.RUNNING,
),
TimerProperty.TOTAL: SensorEntityDescription(
key=TimerProperty.TOTAL,
translation_key=TimerProperty.TOTAL,
),
TimerProperty.LIGHT_START: SensorEntityDescription(
key=TimerProperty.LIGHT_START,
translation_key=TimerProperty.LIGHT_START,
),
TimerProperty.LIGHT_END: SensorEntityDescription(
key=TimerProperty.LIGHT_END,
translation_key=TimerProperty.LIGHT_END,
),
ThinQProperty.ELAPSED_DAY_STATE: SensorEntityDescription(
key=ThinQProperty.ELAPSED_DAY_STATE,
native_unit_of_measurement=UnitOfTime.DAYS,
translation_key=ThinQProperty.ELAPSED_DAY_STATE,
),
ThinQProperty.ELAPSED_DAY_TOTAL: SensorEntityDescription(
key=ThinQProperty.ELAPSED_DAY_TOTAL,
native_unit_of_measurement=UnitOfTime.DAYS,
translation_key=ThinQProperty.ELAPSED_DAY_TOTAL,
),
}
WASHER_SENSORS: tuple[SensorEntityDescription, ...] = (
ERROR_DESC,
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
TIMER_SENSOR_DESC[TimerProperty.RELATIVE_TO_START_WM],
TIMER_SENSOR_DESC[TimerProperty.RELATIVE_TO_STOP_WM],
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
TIMER_SENSOR_DESC[TimerProperty.TOTAL],
)
DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] = {
DeviceType.AIR_CONDITIONER: (
@ -179,6 +333,12 @@ DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] =
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
FILTER_INFO_SENSOR_DESC[ThinQProperty.FILTER_LIFETIME],
TIMER_SENSOR_DESC[TimerProperty.RELATIVE_TO_START],
TIMER_SENSOR_DESC[TimerProperty.RELATIVE_TO_STOP],
TIMER_SENSOR_DESC[TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP],
),
DeviceType.AIR_PURIFIER_FAN: (
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
@ -187,6 +347,9 @@ DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] =
AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TEMPERATURE],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
TIMER_SENSOR_DESC[TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP],
),
DeviceType.AIR_PURIFIER: (
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
@ -194,20 +357,42 @@ DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] =
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
JOB_MODE_SENSOR_DESC[ThinQProperty.PERSONALIZATION_MODE],
),
DeviceType.COOKTOP: (RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],),
DeviceType.COOKTOP: (
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
POWER_SENSOR_DESC[ThinQProperty.POWER_LEVEL],
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
),
DeviceType.DEHUMIDIFIER: (
JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
HUMIDITY_SENSOR_DESC[ThinQProperty.CURRENT_HUMIDITY],
),
DeviceType.DISH_WASHER: (
ERROR_DESC,
DISH_WASHING_COURSE_SENSOR_DESC[ThinQProperty.CURRENT_DISH_WASHING_COURSE],
PREFERENCE_SENSOR_DESC[ThinQProperty.RINSE_LEVEL],
PREFERENCE_SENSOR_DESC[ThinQProperty.SOFTENING_LEVEL],
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
TIMER_SENSOR_DESC[TimerProperty.RELATIVE_TO_START_WM],
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
TIMER_SENSOR_DESC[TimerProperty.TOTAL],
),
DeviceType.DRYER: WASHER_SENSORS,
DeviceType.HOME_BREW: (RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],),
DeviceType.HOME_BREW: (
RECIPE_SENSOR_DESC[ThinQProperty.RECIPE_NAME],
RECIPE_SENSOR_DESC[ThinQProperty.WORT_INFO],
RECIPE_SENSOR_DESC[ThinQProperty.YEAST_INFO],
RECIPE_SENSOR_DESC[ThinQProperty.HOP_OIL_INFO],
RECIPE_SENSOR_DESC[ThinQProperty.FLAVOR_INFO],
RECIPE_SENSOR_DESC[ThinQProperty.BEER_REMAIN],
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
TIMER_SENSOR_DESC[ThinQProperty.ELAPSED_DAY_STATE],
TIMER_SENSOR_DESC[ThinQProperty.ELAPSED_DAY_TOTAL],
),
DeviceType.HOOD: (TIMER_SENSOR_DESC[TimerProperty.REMAIN],),
DeviceType.HUMIDIFIER: (
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
@ -215,6 +400,10 @@ DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] =
AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TEMPERATURE],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
TIMER_SENSOR_DESC[TimerProperty.ABSOLUTE_TO_START],
TIMER_SENSOR_DESC[TimerProperty.ABSOLUTE_TO_STOP],
TIMER_SENSOR_DESC[TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP],
),
DeviceType.KIMCHI_REFRIGERATOR: (
REFRIGERATION_SENSOR_DESC[ThinQProperty.FRESH_AIR_FILTER],
@ -223,28 +412,39 @@ DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] =
translation_key=ThinQProperty.TARGET_TEMPERATURE,
),
),
DeviceType.MICROWAVE_OVEN: (RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],),
DeviceType.MICROWAVE_OVEN: (
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
),
DeviceType.OVEN: (
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
TEMPERATURE_SENSOR_DESC[ThinQProperty.TARGET_TEMPERATURE],
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
TIMER_SENSOR_DESC[TimerProperty.TARGET],
),
DeviceType.PLANT_CULTIVATOR: (
LIGHT_SENSOR_DESC[ThinQProperty.BRIGHTNESS],
LIGHT_SENSOR_DESC[ThinQProperty.DURATION],
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
RUN_STATE_SENSOR_DESC[ThinQProperty.GROWTH_MODE],
RUN_STATE_SENSOR_DESC[ThinQProperty.WIND_VOLUME],
TEMPERATURE_SENSOR_DESC[ThinQProperty.DAY_TARGET_TEMPERATURE],
TEMPERATURE_SENSOR_DESC[ThinQProperty.NIGHT_TARGET_TEMPERATURE],
TEMPERATURE_SENSOR_DESC[ThinQProperty.TEMPERATURE_STATE],
TIMER_SENSOR_DESC[TimerProperty.LIGHT_START],
TIMER_SENSOR_DESC[TimerProperty.LIGHT_END],
),
DeviceType.REFRIGERATOR: (
REFRIGERATION_SENSOR_DESC[ThinQProperty.FRESH_AIR_FILTER],
WATER_FILTER_INFO_SENSOR_DESC[ThinQProperty.USED_TIME],
),
DeviceType.ROBOT_CLEANER: (
ERROR_DESC,
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
TIMER_SENSOR_DESC[TimerProperty.RUNNING],
),
DeviceType.STICK_CLEANER: (
BATTERY_SENSOR_DESC[ThinQProperty.BATTERY_PERCENT],
JOB_MODE_SENSOR_DESC[ThinQPropertyEx.CURRENT_JOB_MODE_STICK_CLEANER],
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
),
@ -285,7 +485,12 @@ async def async_setup_entry(
entities.extend(
ThinQSensorEntity(coordinator, description, property_id)
for property_id in coordinator.api.get_active_idx(
description.key, ActiveMode.READ_ONLY
description.key,
(
ActiveMode.READABLE
if coordinator.api.device.device_type == DeviceType.COOKTOP
else ActiveMode.READ_ONLY
),
)
)
@ -319,10 +524,11 @@ class ThinQSensorEntity(ThinQEntity, SensorEntity):
self._attr_native_unit_of_measurement = data_unit
_LOGGER.debug(
"[%s:%s] update status: %s, options:%s, unit:%s",
"[%s:%s] update status: %s -> %s, options:%s, unit:%s",
self.coordinator.device_name,
self.property_id,
self.data.value,
self.native_value,
self.options,
self.native_unit_of_measurement,
)

View file

@ -39,7 +39,7 @@
"name": "Mood light"
},
"operation_power": {
"name": "Power"
"name": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::high%]"
},
"optimal_humidity": {
"name": "Ventilation"
@ -101,8 +101,8 @@
"low": "Low",
"mid": "Medium",
"high": "High",
"power": "Power",
"auto": "Auto"
"power": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::high%]",
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]"
}
},
"preset_mode": {
@ -274,12 +274,32 @@
}
},
"sensor": {
"error": {
"name": "Error"
"odor_level": {
"name": "Odor",
"state": {
"invalid": "Invalid",
"weak": "Weak",
"normal": "Normal",
"strong": "Strong",
"very_strong": "Very strong"
}
},
"current_temperature": {
"name": "Current temperature"
},
"temperature": {
"name": "Temperature"
},
"total_pollution_level": {
"name": "Overall air quality",
"state": {
"invalid": "Invalid",
"good": "Good",
"normal": "Moderate",
"bad": "Unhealthy",
"very_bad": "Poor"
}
},
"monitoring_enabled": {
"name": "Air quality sensor",
"state": {
@ -310,6 +330,18 @@
"wind_volume_for_location": {
"name": "{location} wind speed"
},
"brightness": {
"name": "Lighting intensity"
},
"brightness_for_location": {
"name": "{location} lighting intensity"
},
"duration": {
"name": "Lighting duration"
},
"duration_for_location": {
"name": "{location} lighting duration"
},
"day_target_temperature": {
"name": "Day growth temperature"
},
@ -517,13 +549,16 @@
"state": {
"off": "[%key:common::state::off%]",
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]",
"power": "Power",
"power": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::high%]",
"replace": "Replace filter",
"smart_power": "Smart safe storage",
"smart_off": "[%key:common::state::off%]",
"smart_on": "[%key:component::lg_thinq::entity::sensor::fresh_air_filter::state::smart_power%]"
}
},
"filter_lifetime": {
"name": "Filter remaining"
},
"used_time": {
"name": "Water filter used"
},
@ -535,7 +570,7 @@
"clothes_dry": "Laundry",
"edge": "Edge cleaning",
"heat_pump": "Heat pump",
"high": "[%key:component::lg_thinq::entity::sensor::temperature_state::state::high%]",
"high": "Power",
"intensive_dry": "Spot",
"macro": "Custom mode",
"mop": "Mop",
@ -556,7 +591,7 @@
"name": "Operating mode",
"state": {
"auto": "Low power",
"high": "[%key:component::lg_thinq::entity::sensor::temperature_state::state::high%]",
"high": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::high%]",
"mop": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::mop%]",
"normal": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::normal%]",
"off": "[%key:common::state::off%]",
@ -578,10 +613,50 @@
"others": "Others"
}
},
"current_dish_washing_course": {
"name": "Current cycle",
"state": {
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]",
"heavy": "Intensive",
"delicate": "Delicate",
"turbo": "[%key:component::lg_thinq::entity::select::wind_strength::state::power%]",
"normal": "Normal",
"rinse": "Rinse",
"refresh": "Refresh",
"express": "Express",
"machine_clean": "Machine clean",
"short_mode": "Short mode",
"download_cycle": "Download cycle",
"quick": "Quick",
"steam": "Steam care",
"spray": "Spray",
"eco": "Eco"
}
},
"rinse_level": {
"name": "Rinse aid dispenser level",
"state": {
"rinselevel_0": "0",
"rinselevel_1": "1",
"rinselevel_2": "2",
"rinselevel_3": "3",
"rinselevel_4": "4"
}
},
"softening_level": {
"name": "Softening level",
"state": {
"softeninglevel_0": "[%key:component::lg_thinq::entity::sensor::rinse_level::state::rinselevel_0%]",
"softeninglevel_1": "[%key:component::lg_thinq::entity::sensor::rinse_level::state::rinselevel_1%]",
"softeninglevel_2": "[%key:component::lg_thinq::entity::sensor::rinse_level::state::rinselevel_2%]",
"softeninglevel_3": "[%key:component::lg_thinq::entity::sensor::rinse_level::state::rinselevel_3%]",
"softeninglevel_4": "[%key:component::lg_thinq::entity::sensor::rinse_level::state::rinselevel_4%]"
}
},
"cock_state": {
"name": "[%key:component::lg_thinq::entity::switch::uv_nano::name%]",
"state": {
"cleaning": "[%key:component::lg_thinq::entity::sensor::current_state::state::cleaning%]",
"cleaning": "In progress",
"normal": "[%key:common::state::standby%]"
}
},
@ -623,6 +698,144 @@
"vegetable_fruit": "[%key:component::lg_thinq::entity::sensor::target_temperature::state::vegetable_fruit%]",
"temperature_number": "[%key:component::lg_thinq::entity::sensor::target_temperature::state::temperature_number%]"
}
},
"elapsed_day_state": {
"name": "Brewing period"
},
"elapsed_day_total": {
"name": "Brewing duration"
},
"recipe_name": {
"name": "Homebrew recipe",
"state": {
"ipa": "IPA",
"pale_ale": "Pale ale",
"stout": "Stout",
"wheat": "Wheat",
"pilsner": "Pilsner",
"red_ale": "Red ale",
"my_recipe": "My recipe"
}
},
"wort_info": {
"name": "Wort",
"state": {
"hoppy": "Hoppy",
"deep_gold": "DeepGold",
"wheat": "Wheat",
"dark": "Dark"
}
},
"yeast_info": {
"name": "Yeast",
"state": {
"american_ale": "American ale",
"english_ale": "English ale",
"lager": "Lager",
"weizen": "Weizen"
}
},
"hop_oil_info": {
"name": "Hops"
},
"flavor_info": {
"name": "Flavor"
},
"beer_remain": {
"name": "Recipe progress"
},
"battery_level": {
"name": "Battery",
"state": {
"high": "Full",
"mid": "Medium",
"low": "Low",
"warning": "Empty"
}
},
"relative_to_start": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start::name%]"
},
"relative_to_start_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start_for_location::name%]"
},
"relative_to_start_wm": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start_wm::name%]"
},
"relative_to_start_wm_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start_wm_for_location::name%]"
},
"relative_to_stop": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop::name%]"
},
"relative_to_stop_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop_for_location::name%]"
},
"relative_to_stop_wm": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop_wm::name%]"
},
"relative_to_stop_wm_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop_wm_for_location::name%]"
},
"sleep_timer_relative_to_stop": {
"name": "[%key:component::lg_thinq::entity::number::sleep_timer_relative_hour_to_stop::name%]"
},
"sleep_timer_relative_to_stop_for_location": {
"name": "[%key:component::lg_thinq::entity::number::sleep_timer_relative_hour_to_stop_for_location::name%]"
},
"absolute_to_start": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start::name%]"
},
"absolute_to_start_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_start_for_location::name%]"
},
"absolute_to_stop": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop::name%]"
},
"absolute_to_stop_for_location": {
"name": "[%key:component::lg_thinq::entity::number::relative_hour_to_stop_for_location::name%]"
},
"remain": {
"name": "Remaining time"
},
"remain_for_location": {
"name": "{location} remaining time"
},
"running": {
"name": "Running time"
},
"running_for_location": {
"name": "{location} running time"
},
"total": {
"name": "Total time"
},
"total_for_location": {
"name": "{location} total time"
},
"target": {
"name": "Cook time"
},
"target_for_location": {
"name": "{location} cook time"
},
"light_start": {
"name": "Lights on time"
},
"light_start_for_location": {
"name": "{location} lights on time"
},
"light_end": {
"name": "Lights off time"
},
"light_end_for_location": {
"name": "{location} lights off time"
},
"power_level": {
"name": "Power level"
},
"power_level_for_location": {
"name": "{location} power level"
}
},
"select": {
@ -635,7 +848,7 @@
"high": "High",
"power": "Turbo",
"turbo": "[%key:component::lg_thinq::entity::select::wind_strength::state::power%]",
"auto": "Auto",
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]",
"wind_1": "Step 1",
"wind_2": "Step 2",
"wind_3": "Step 3",
@ -659,7 +872,7 @@
"name": "Operating mode",
"state": {
"air_clean": "Purifying",
"auto": "[%key:component::lg_thinq::entity::select::wind_strength::state::auto%]",
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]",
"baby_care": "[%key:component::lg_thinq::entity::sensor::personalization_mode::state::baby%]",
"circulator": "Booster",
"clean": "Single",
@ -757,8 +970,8 @@
"name": "[%key:component::lg_thinq::entity::binary_sensor::one_touch_filter::name%]",
"state": {
"off": "[%key:common::state::off%]",
"auto": "[%key:component::lg_thinq::entity::select::wind_strength::state::auto%]",
"power": "Power",
"auto": "[%key:component::lg_thinq::entity::sensor::growth_mode::state::standard%]",
"power": "[%key:component::lg_thinq::entity::sensor::current_job_mode::state::high%]",
"replace": "[%key:component::lg_thinq::entity::sensor::fresh_air_filter::state::replace%]",
"smart_power": "[%key:component::lg_thinq::entity::sensor::fresh_air_filter::state::smart_power%]",
"smart_off": "[%key:common::state::off%]",
@ -771,7 +984,7 @@
"off": "[%key:common::state::off%]",
"fast": "Fast",
"silent": "Silent",
"normal": "Delicate"
"normal": "[%key:component::lg_thinq::entity::sensor::current_dish_washing_course::state::delicate%]"
}
}
}