Skip to content

Commit f481c1b

Browse files
Add sensors for ventilator in LG ThinQ (home-assistant#140846)
Co-authored-by: yunseon.park <[email protected]>
1 parent eea22d8 commit f481c1b

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

homeassistant/components/lg_thinq/icons.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@
219219
"total_pollution_level": {
220220
"default": "mdi:air-filter"
221221
},
222+
"carbon_dioxide": {
223+
"default": "mdi:molecule-co2"
224+
},
222225
"monitoring_enabled": {
223226
"default": "mdi:monitor-eye"
224227
},
@@ -330,9 +333,21 @@
330333
"hop_oil_info": {
331334
"default": "mdi:information-box-outline"
332335
},
336+
"hop_oil_capsule_1": {
337+
"default": "mdi:information-box-outline"
338+
},
339+
"hop_oil_capsule_2": {
340+
"default": "mdi:information-box-outline"
341+
},
333342
"flavor_info": {
334343
"default": "mdi:information-box-outline"
335344
},
345+
"flavor_capsule_1": {
346+
"default": "mdi:information-box-outline"
347+
},
348+
"flavor_capsule_2": {
349+
"default": "mdi:information-box-outline"
350+
},
336351
"beer_remain": {
337352
"default": "mdi:glass-mug-variant"
338353
},

homeassistant/components/lg_thinq/sensor.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
device_class=SensorDeviceClass.ENUM,
7676
translation_key=ThinQProperty.TOTAL_POLLUTION_LEVEL,
7777
),
78+
ThinQProperty.CO2: SensorEntityDescription(
79+
key=ThinQProperty.CO2,
80+
device_class=SensorDeviceClass.ENUM,
81+
translation_key="carbon_dioxide",
82+
),
7883
}
7984
BATTERY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
8085
ThinQProperty.BATTERY_PERCENT: SensorEntityDescription(
@@ -175,10 +180,30 @@
175180
key=ThinQProperty.HOP_OIL_INFO,
176181
translation_key=ThinQProperty.HOP_OIL_INFO,
177182
),
183+
ThinQProperty.HOP_OIL_CAPSULE_1: SensorEntityDescription(
184+
key=ThinQProperty.HOP_OIL_CAPSULE_1,
185+
device_class=SensorDeviceClass.ENUM,
186+
translation_key=ThinQProperty.HOP_OIL_CAPSULE_1,
187+
),
188+
ThinQProperty.HOP_OIL_CAPSULE_2: SensorEntityDescription(
189+
key=ThinQProperty.HOP_OIL_CAPSULE_2,
190+
device_class=SensorDeviceClass.ENUM,
191+
translation_key=ThinQProperty.HOP_OIL_CAPSULE_2,
192+
),
178193
ThinQProperty.FLAVOR_INFO: SensorEntityDescription(
179194
key=ThinQProperty.FLAVOR_INFO,
180195
translation_key=ThinQProperty.FLAVOR_INFO,
181196
),
197+
ThinQProperty.FLAVOR_CAPSULE_1: SensorEntityDescription(
198+
key=ThinQProperty.FLAVOR_CAPSULE_1,
199+
device_class=SensorDeviceClass.ENUM,
200+
translation_key=ThinQProperty.FLAVOR_CAPSULE_1,
201+
),
202+
ThinQProperty.FLAVOR_CAPSULE_2: SensorEntityDescription(
203+
key=ThinQProperty.FLAVOR_CAPSULE_2,
204+
device_class=SensorDeviceClass.ENUM,
205+
translation_key=ThinQProperty.FLAVOR_CAPSULE_2,
206+
),
182207
ThinQProperty.BEER_REMAIN: SensorEntityDescription(
183208
key=ThinQProperty.BEER_REMAIN,
184209
native_unit_of_measurement=PERCENTAGE,
@@ -415,6 +440,7 @@
415440
DeviceType.COOKTOP: (
416441
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
417442
POWER_SENSOR_DESC[ThinQProperty.POWER_LEVEL],
443+
TIMER_SENSOR_DESC[TimerProperty.REMAIN],
418444
),
419445
DeviceType.DEHUMIDIFIER: (
420446
JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
@@ -435,7 +461,11 @@
435461
RECIPE_SENSOR_DESC[ThinQProperty.WORT_INFO],
436462
RECIPE_SENSOR_DESC[ThinQProperty.YEAST_INFO],
437463
RECIPE_SENSOR_DESC[ThinQProperty.HOP_OIL_INFO],
464+
RECIPE_SENSOR_DESC[ThinQProperty.HOP_OIL_CAPSULE_1],
465+
RECIPE_SENSOR_DESC[ThinQProperty.HOP_OIL_CAPSULE_2],
438466
RECIPE_SENSOR_DESC[ThinQProperty.FLAVOR_INFO],
467+
RECIPE_SENSOR_DESC[ThinQProperty.FLAVOR_CAPSULE_1],
468+
RECIPE_SENSOR_DESC[ThinQProperty.FLAVOR_CAPSULE_2],
439469
RECIPE_SENSOR_DESC[ThinQProperty.BEER_REMAIN],
440470
RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
441471
ELAPSED_DAY_SENSOR_DESC[ThinQProperty.ELAPSED_DAY_STATE],
@@ -497,6 +527,16 @@
497527
TEMPERATURE_SENSOR_DESC[ThinQPropertyEx.ROOM_IN_WATER_CURRENT_TEMPERATURE],
498528
TEMPERATURE_SENSOR_DESC[ThinQPropertyEx.ROOM_OUT_WATER_CURRENT_TEMPERATURE],
499529
),
530+
DeviceType.VENTILATOR: (
531+
AIR_QUALITY_SENSOR_DESC[ThinQProperty.CO2],
532+
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
533+
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
534+
AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
535+
TEMPERATURE_SENSOR_DESC[ThinQProperty.CURRENT_TEMPERATURE],
536+
TIME_SENSOR_DESC[TimerProperty.ABSOLUTE_TO_START],
537+
TIME_SENSOR_DESC[TimerProperty.ABSOLUTE_TO_STOP],
538+
TIMER_SENSOR_DESC[TimerProperty.SLEEP_TIMER_RELATIVE_TO_STOP],
539+
),
500540
DeviceType.WASHCOMBO_MAIN: WASHER_SENSORS,
501541
DeviceType.WASHCOMBO_MINI: WASHER_SENSORS,
502542
DeviceType.WASHER: WASHER_SENSORS,

homeassistant/components/lg_thinq/strings.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,19 @@
333333
"very_bad": "Poor"
334334
}
335335
},
336+
"carbon_dioxide": {
337+
"name": "[%key:component::sensor::entity_component::carbon_dioxide::name%]",
338+
"state": {
339+
"invalid": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::invalid%]",
340+
"good": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::good%]",
341+
"normal": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::normal%]",
342+
"moderate": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::normal%]",
343+
"bad": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::bad%]",
344+
"unhealthy": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::bad%]",
345+
"very_bad": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::very_bad%]",
346+
"poor": "[%key:component::lg_thinq::entity::sensor::total_pollution_level::state::very_bad%]"
347+
}
348+
},
336349
"monitoring_enabled": {
337350
"name": "Air quality sensor",
338351
"state": {
@@ -771,9 +784,47 @@
771784
"hop_oil_info": {
772785
"name": "Hops"
773786
},
787+
"hop_oil_capsule_1": {
788+
"name": "First hop",
789+
"state": {
790+
"cascade": "Cascade",
791+
"chinook": "Chinook",
792+
"goldings": "Goldings",
793+
"fuggles": "Fuggles",
794+
"hallertau": "Hallertau",
795+
"citrussy": "Citrussy"
796+
}
797+
},
798+
"hop_oil_capsule_2": {
799+
"name": "Second hop",
800+
"state": {
801+
"cascade": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::cascade%]",
802+
"chinook": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::chinook%]",
803+
"goldings": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::goldings%]",
804+
"fuggles": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::fuggles%]",
805+
"hallertau": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::hallertau%]",
806+
"citrussy": "[%key:component::lg_thinq::entity::sensor::hop_oil_capsule_1::state::citrussy%]"
807+
}
808+
},
774809
"flavor_info": {
775810
"name": "Flavor"
776811
},
812+
"flavor_capsule_1": {
813+
"name": "First flavor",
814+
"state": {
815+
"coriander": "Coriander",
816+
"coriander_seed": "[%key:component::lg_thinq::entity::sensor::flavor_capsule_1::state::coriander%]",
817+
"orange": "Orange"
818+
}
819+
},
820+
"flavor_capsule_2": {
821+
"name": "Second flavor",
822+
"state": {
823+
"coriander": "[%key:component::lg_thinq::entity::sensor::flavor_capsule_1::state::coriander%]",
824+
"coriander_seed": "[%key:component::lg_thinq::entity::sensor::flavor_capsule_1::state::coriander%]",
825+
"orange": "[%key:component::lg_thinq::entity::sensor::flavor_capsule_1::state::orange%]"
826+
}
827+
},
777828
"beer_remain": {
778829
"name": "Recipe progress"
779830
},

0 commit comments

Comments
 (0)