Home Assistant Unofficial Reference 2024.12.1
sensor.py
Go to the documentation of this file.
1 """Support for sensor entities."""
2 
3 from __future__ import annotations
4 
5 import logging
6 
7 from thinqconnect import DeviceType
8 from thinqconnect.devices.const import Property as ThinQProperty
9 from thinqconnect.integration import ActiveMode, ThinQPropertyEx, TimerProperty
10 
12  SensorDeviceClass,
13  SensorEntity,
14  SensorEntityDescription,
15  SensorStateClass,
16 )
17 from homeassistant.const import (
18  CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
19  PERCENTAGE,
20  UnitOfTemperature,
21  UnitOfTime,
22 )
23 from homeassistant.core import HomeAssistant
24 from homeassistant.helpers.entity_platform import AddEntitiesCallback
25 
26 from . import ThinqConfigEntry
27 from .coordinator import DeviceDataUpdateCoordinator
28 from .entity import ThinQEntity
29 
30 AIR_QUALITY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
31  ThinQProperty.PM1: SensorEntityDescription(
32  key=ThinQProperty.PM1,
33  device_class=SensorDeviceClass.PM1,
34  native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
35  state_class=SensorStateClass.MEASUREMENT,
36  ),
37  ThinQProperty.PM2: SensorEntityDescription(
38  key=ThinQProperty.PM2,
39  device_class=SensorDeviceClass.PM25,
40  native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
41  state_class=SensorStateClass.MEASUREMENT,
42  ),
43  ThinQProperty.PM10: SensorEntityDescription(
44  key=ThinQProperty.PM10,
45  device_class=SensorDeviceClass.PM10,
46  native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
47  state_class=SensorStateClass.MEASUREMENT,
48  ),
49  ThinQProperty.HUMIDITY: SensorEntityDescription(
50  key=ThinQProperty.HUMIDITY,
51  device_class=SensorDeviceClass.HUMIDITY,
52  native_unit_of_measurement=PERCENTAGE,
53  state_class=SensorStateClass.MEASUREMENT,
54  ),
55  ThinQProperty.MONITORING_ENABLED: SensorEntityDescription(
56  key=ThinQProperty.MONITORING_ENABLED,
57  device_class=SensorDeviceClass.ENUM,
58  translation_key=ThinQProperty.MONITORING_ENABLED,
59  ),
60  ThinQProperty.TEMPERATURE: SensorEntityDescription(
61  key=ThinQProperty.TEMPERATURE,
62  native_unit_of_measurement=UnitOfTemperature.CELSIUS,
63  state_class=SensorStateClass.MEASUREMENT,
64  translation_key=ThinQProperty.TEMPERATURE,
65  ),
66  ThinQProperty.ODOR_LEVEL: SensorEntityDescription(
67  key=ThinQProperty.ODOR_LEVEL,
68  device_class=SensorDeviceClass.ENUM,
69  translation_key=ThinQProperty.ODOR_LEVEL,
70  ),
71  ThinQProperty.TOTAL_POLLUTION_LEVEL: SensorEntityDescription(
72  key=ThinQProperty.TOTAL_POLLUTION_LEVEL,
73  device_class=SensorDeviceClass.ENUM,
74  translation_key=ThinQProperty.TOTAL_POLLUTION_LEVEL,
75  ),
76 }
77 BATTERY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
78  ThinQProperty.BATTERY_PERCENT: SensorEntityDescription(
79  key=ThinQProperty.BATTERY_PERCENT,
80  translation_key=ThinQProperty.BATTERY_LEVEL,
81  ),
82 }
83 DISH_WASHING_COURSE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
84  ThinQProperty.CURRENT_DISH_WASHING_COURSE: SensorEntityDescription(
85  key=ThinQProperty.CURRENT_DISH_WASHING_COURSE,
86  device_class=SensorDeviceClass.ENUM,
87  translation_key=ThinQProperty.CURRENT_DISH_WASHING_COURSE,
88  )
89 }
90 FILTER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
91  ThinQProperty.FILTER_LIFETIME: SensorEntityDescription(
92  key=ThinQProperty.FILTER_LIFETIME,
93  native_unit_of_measurement=UnitOfTime.HOURS,
94  translation_key=ThinQProperty.FILTER_LIFETIME,
95  ),
96 }
97 HUMIDITY_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
98  ThinQProperty.CURRENT_HUMIDITY: SensorEntityDescription(
99  key=ThinQProperty.CURRENT_HUMIDITY,
100  device_class=SensorDeviceClass.HUMIDITY,
101  native_unit_of_measurement=PERCENTAGE,
102  state_class=SensorStateClass.MEASUREMENT,
103  )
104 }
105 JOB_MODE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
106  ThinQProperty.CURRENT_JOB_MODE: SensorEntityDescription(
107  key=ThinQProperty.CURRENT_JOB_MODE,
108  device_class=SensorDeviceClass.ENUM,
109  translation_key=ThinQProperty.CURRENT_JOB_MODE,
110  ),
111  ThinQPropertyEx.CURRENT_JOB_MODE_STICK_CLEANER: SensorEntityDescription(
112  key=ThinQProperty.CURRENT_JOB_MODE,
113  device_class=SensorDeviceClass.ENUM,
114  translation_key=ThinQPropertyEx.CURRENT_JOB_MODE_STICK_CLEANER,
115  ),
116  ThinQProperty.PERSONALIZATION_MODE: SensorEntityDescription(
117  key=ThinQProperty.PERSONALIZATION_MODE,
118  device_class=SensorDeviceClass.ENUM,
119  translation_key=ThinQProperty.PERSONALIZATION_MODE,
120  ),
121 }
122 LIGHT_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
123  ThinQProperty.BRIGHTNESS: SensorEntityDescription(
124  key=ThinQProperty.BRIGHTNESS,
125  translation_key=ThinQProperty.BRIGHTNESS,
126  ),
127  ThinQProperty.DURATION: SensorEntityDescription(
128  key=ThinQProperty.DURATION,
129  native_unit_of_measurement=UnitOfTime.HOURS,
130  translation_key=ThinQProperty.DURATION,
131  ),
132 }
133 POWER_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
134  ThinQProperty.POWER_LEVEL: SensorEntityDescription(
135  key=ThinQProperty.POWER_LEVEL,
136  translation_key=ThinQProperty.POWER_LEVEL,
137  )
138 }
139 PREFERENCE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
140  ThinQProperty.RINSE_LEVEL: SensorEntityDescription(
141  key=ThinQProperty.RINSE_LEVEL,
142  device_class=SensorDeviceClass.ENUM,
143  translation_key=ThinQProperty.RINSE_LEVEL,
144  ),
145  ThinQProperty.SOFTENING_LEVEL: SensorEntityDescription(
146  key=ThinQProperty.SOFTENING_LEVEL,
147  device_class=SensorDeviceClass.ENUM,
148  translation_key=ThinQProperty.SOFTENING_LEVEL,
149  ),
150 }
151 RECIPE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
152  ThinQProperty.RECIPE_NAME: SensorEntityDescription(
153  key=ThinQProperty.RECIPE_NAME,
154  device_class=SensorDeviceClass.ENUM,
155  translation_key=ThinQProperty.RECIPE_NAME,
156  ),
157  ThinQProperty.WORT_INFO: SensorEntityDescription(
158  key=ThinQProperty.WORT_INFO,
159  device_class=SensorDeviceClass.ENUM,
160  translation_key=ThinQProperty.WORT_INFO,
161  ),
162  ThinQProperty.YEAST_INFO: SensorEntityDescription(
163  key=ThinQProperty.YEAST_INFO,
164  device_class=SensorDeviceClass.ENUM,
165  translation_key=ThinQProperty.YEAST_INFO,
166  ),
167  ThinQProperty.HOP_OIL_INFO: SensorEntityDescription(
168  key=ThinQProperty.HOP_OIL_INFO,
169  translation_key=ThinQProperty.HOP_OIL_INFO,
170  ),
171  ThinQProperty.FLAVOR_INFO: SensorEntityDescription(
172  key=ThinQProperty.FLAVOR_INFO,
173  translation_key=ThinQProperty.FLAVOR_INFO,
174  ),
175  ThinQProperty.BEER_REMAIN: SensorEntityDescription(
176  key=ThinQProperty.BEER_REMAIN,
177  native_unit_of_measurement=PERCENTAGE,
178  translation_key=ThinQProperty.BEER_REMAIN,
179  ),
180 }
181 REFRIGERATION_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
182  ThinQProperty.FRESH_AIR_FILTER: SensorEntityDescription(
183  key=ThinQProperty.FRESH_AIR_FILTER,
184  device_class=SensorDeviceClass.ENUM,
185  translation_key=ThinQProperty.FRESH_AIR_FILTER,
186  ),
187 }
188 RUN_STATE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
189  ThinQProperty.CURRENT_STATE: SensorEntityDescription(
190  key=ThinQProperty.CURRENT_STATE,
191  device_class=SensorDeviceClass.ENUM,
192  translation_key=ThinQProperty.CURRENT_STATE,
193  ),
194  ThinQProperty.COCK_STATE: SensorEntityDescription(
195  key=ThinQProperty.COCK_STATE,
196  device_class=SensorDeviceClass.ENUM,
197  translation_key=ThinQProperty.COCK_STATE,
198  ),
199  ThinQProperty.STERILIZING_STATE: SensorEntityDescription(
200  key=ThinQProperty.STERILIZING_STATE,
201  device_class=SensorDeviceClass.ENUM,
202  translation_key=ThinQProperty.STERILIZING_STATE,
203  ),
204  ThinQProperty.GROWTH_MODE: SensorEntityDescription(
205  key=ThinQProperty.GROWTH_MODE,
206  device_class=SensorDeviceClass.ENUM,
207  translation_key=ThinQProperty.GROWTH_MODE,
208  ),
209  ThinQProperty.WIND_VOLUME: SensorEntityDescription(
210  key=ThinQProperty.WIND_VOLUME,
211  device_class=SensorDeviceClass.WIND_SPEED,
212  translation_key=ThinQProperty.WIND_VOLUME,
213  ),
214 }
215 TEMPERATURE_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
216  ThinQProperty.TARGET_TEMPERATURE: SensorEntityDescription(
217  key=ThinQProperty.TARGET_TEMPERATURE,
218  native_unit_of_measurement=UnitOfTemperature.CELSIUS,
219  translation_key=ThinQProperty.TARGET_TEMPERATURE,
220  ),
221  ThinQProperty.DAY_TARGET_TEMPERATURE: SensorEntityDescription(
222  key=ThinQProperty.DAY_TARGET_TEMPERATURE,
223  native_unit_of_measurement=UnitOfTemperature.CELSIUS,
224  state_class=SensorStateClass.MEASUREMENT,
225  translation_key=ThinQProperty.DAY_TARGET_TEMPERATURE,
226  ),
227  ThinQProperty.NIGHT_TARGET_TEMPERATURE: SensorEntityDescription(
228  key=ThinQProperty.NIGHT_TARGET_TEMPERATURE,
229  native_unit_of_measurement=UnitOfTemperature.CELSIUS,
230  state_class=SensorStateClass.MEASUREMENT,
231  translation_key=ThinQProperty.NIGHT_TARGET_TEMPERATURE,
232  ),
233  ThinQProperty.TEMPERATURE_STATE: SensorEntityDescription(
234  key=ThinQProperty.TEMPERATURE_STATE,
235  device_class=SensorDeviceClass.ENUM,
236  translation_key=ThinQProperty.TEMPERATURE_STATE,
237  ),
238  ThinQProperty.CURRENT_TEMPERATURE: SensorEntityDescription(
239  key=ThinQProperty.CURRENT_TEMPERATURE,
240  native_unit_of_measurement=UnitOfTemperature.CELSIUS,
241  state_class=SensorStateClass.MEASUREMENT,
242  translation_key=ThinQProperty.CURRENT_TEMPERATURE,
243  ),
244 }
245 WATER_FILTER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
246  ThinQProperty.USED_TIME: SensorEntityDescription(
247  key=ThinQProperty.USED_TIME,
248  native_unit_of_measurement=UnitOfTime.MONTHS,
249  translation_key=ThinQProperty.USED_TIME,
250  ),
251 }
252 WATER_INFO_SENSOR_DESC: dict[ThinQProperty, SensorEntityDescription] = {
253  ThinQProperty.WATER_TYPE: SensorEntityDescription(
254  key=ThinQProperty.WATER_TYPE,
255  translation_key=ThinQProperty.WATER_TYPE,
256  ),
257 }
258 
259 WASHER_SENSORS: tuple[SensorEntityDescription, ...] = (
260  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
261 )
262 DEVICE_TYPE_SENSOR_MAP: dict[DeviceType, tuple[SensorEntityDescription, ...]] = {
263  DeviceType.AIR_CONDITIONER: (
264  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
265  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
266  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
267  AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
268  AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
269  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
270  FILTER_INFO_SENSOR_DESC[ThinQProperty.FILTER_LIFETIME],
271  ),
272  DeviceType.AIR_PURIFIER_FAN: (
273  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
274  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
275  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
276  AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
277  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TEMPERATURE],
278  AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
279  AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
280  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
281  ),
282  DeviceType.AIR_PURIFIER: (
283  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
284  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
285  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
286  AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
287  AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
288  AIR_QUALITY_SENSOR_DESC[ThinQProperty.ODOR_LEVEL],
289  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
290  JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
291  JOB_MODE_SENSOR_DESC[ThinQProperty.PERSONALIZATION_MODE],
292  ),
293  DeviceType.COOKTOP: (
294  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
295  POWER_SENSOR_DESC[ThinQProperty.POWER_LEVEL],
296  ),
297  DeviceType.DEHUMIDIFIER: (
298  JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
299  HUMIDITY_SENSOR_DESC[ThinQProperty.CURRENT_HUMIDITY],
300  ),
301  DeviceType.DISH_WASHER: (
302  DISH_WASHING_COURSE_SENSOR_DESC[ThinQProperty.CURRENT_DISH_WASHING_COURSE],
303  PREFERENCE_SENSOR_DESC[ThinQProperty.RINSE_LEVEL],
304  PREFERENCE_SENSOR_DESC[ThinQProperty.SOFTENING_LEVEL],
305  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
306  ),
307  DeviceType.DRYER: WASHER_SENSORS,
308  DeviceType.HOME_BREW: (
309  RECIPE_SENSOR_DESC[ThinQProperty.RECIPE_NAME],
310  RECIPE_SENSOR_DESC[ThinQProperty.WORT_INFO],
311  RECIPE_SENSOR_DESC[ThinQProperty.YEAST_INFO],
312  RECIPE_SENSOR_DESC[ThinQProperty.HOP_OIL_INFO],
313  RECIPE_SENSOR_DESC[ThinQProperty.FLAVOR_INFO],
314  RECIPE_SENSOR_DESC[ThinQProperty.BEER_REMAIN],
315  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
316  ),
317  DeviceType.HUMIDIFIER: (
318  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM1],
319  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM2],
320  AIR_QUALITY_SENSOR_DESC[ThinQProperty.PM10],
321  AIR_QUALITY_SENSOR_DESC[ThinQProperty.HUMIDITY],
322  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TEMPERATURE],
323  AIR_QUALITY_SENSOR_DESC[ThinQProperty.MONITORING_ENABLED],
324  AIR_QUALITY_SENSOR_DESC[ThinQProperty.TOTAL_POLLUTION_LEVEL],
325  ),
326  DeviceType.KIMCHI_REFRIGERATOR: (
327  REFRIGERATION_SENSOR_DESC[ThinQProperty.FRESH_AIR_FILTER],
329  key=ThinQProperty.TARGET_TEMPERATURE,
330  translation_key=ThinQProperty.TARGET_TEMPERATURE,
331  ),
332  ),
333  DeviceType.MICROWAVE_OVEN: (RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],),
334  DeviceType.OVEN: (
335  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
336  TEMPERATURE_SENSOR_DESC[ThinQProperty.TARGET_TEMPERATURE],
337  ),
338  DeviceType.PLANT_CULTIVATOR: (
339  LIGHT_SENSOR_DESC[ThinQProperty.BRIGHTNESS],
340  LIGHT_SENSOR_DESC[ThinQProperty.DURATION],
341  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
342  RUN_STATE_SENSOR_DESC[ThinQProperty.GROWTH_MODE],
343  RUN_STATE_SENSOR_DESC[ThinQProperty.WIND_VOLUME],
344  TEMPERATURE_SENSOR_DESC[ThinQProperty.DAY_TARGET_TEMPERATURE],
345  TEMPERATURE_SENSOR_DESC[ThinQProperty.NIGHT_TARGET_TEMPERATURE],
346  TEMPERATURE_SENSOR_DESC[ThinQProperty.TEMPERATURE_STATE],
347  ),
348  DeviceType.REFRIGERATOR: (
349  REFRIGERATION_SENSOR_DESC[ThinQProperty.FRESH_AIR_FILTER],
350  WATER_FILTER_INFO_SENSOR_DESC[ThinQProperty.USED_TIME],
351  ),
352  DeviceType.ROBOT_CLEANER: (
353  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
354  JOB_MODE_SENSOR_DESC[ThinQProperty.CURRENT_JOB_MODE],
355  ),
356  DeviceType.STICK_CLEANER: (
357  BATTERY_SENSOR_DESC[ThinQProperty.BATTERY_PERCENT],
358  JOB_MODE_SENSOR_DESC[ThinQPropertyEx.CURRENT_JOB_MODE_STICK_CLEANER],
359  RUN_STATE_SENSOR_DESC[ThinQProperty.CURRENT_STATE],
360  ),
361  DeviceType.STYLER: WASHER_SENSORS,
362  DeviceType.WASHCOMBO_MAIN: WASHER_SENSORS,
363  DeviceType.WASHCOMBO_MINI: WASHER_SENSORS,
364  DeviceType.WASHER: WASHER_SENSORS,
365  DeviceType.WASHTOWER_DRYER: WASHER_SENSORS,
366  DeviceType.WASHTOWER: WASHER_SENSORS,
367  DeviceType.WASHTOWER_WASHER: WASHER_SENSORS,
368  DeviceType.WATER_HEATER: (
369  TEMPERATURE_SENSOR_DESC[ThinQProperty.CURRENT_TEMPERATURE],
370  ),
371  DeviceType.WATER_PURIFIER: (
372  RUN_STATE_SENSOR_DESC[ThinQProperty.COCK_STATE],
373  RUN_STATE_SENSOR_DESC[ThinQProperty.STERILIZING_STATE],
374  WATER_INFO_SENSOR_DESC[ThinQProperty.WATER_TYPE],
375  ),
376 }
377 
378 _LOGGER = logging.getLogger(__name__)
379 
380 
382  hass: HomeAssistant,
383  entry: ThinqConfigEntry,
384  async_add_entities: AddEntitiesCallback,
385 ) -> None:
386  """Set up an entry for sensor platform."""
387  entities: list[ThinQSensorEntity] = []
388  for coordinator in entry.runtime_data.coordinators.values():
389  if (
390  descriptions := DEVICE_TYPE_SENSOR_MAP.get(
391  coordinator.api.device.device_type
392  )
393  ) is not None:
394  for description in descriptions:
395  entities.extend(
396  ThinQSensorEntity(coordinator, description, property_id)
397  for property_id in coordinator.api.get_active_idx(
398  description.key,
399  (
400  ActiveMode.READABLE
401  if (
402  coordinator.api.device.device_type == DeviceType.COOKTOP
403  or isinstance(description.key, TimerProperty)
404  )
405  else ActiveMode.READ_ONLY
406  ),
407  )
408  )
409 
410  if entities:
411  async_add_entities(entities)
412 
413 
415  """Represent a thinq sensor platform."""
416 
417  def __init__(
418  self,
419  coordinator: DeviceDataUpdateCoordinator,
420  entity_description: SensorEntityDescription,
421  property_id: str,
422  ) -> None:
423  """Initialize a sensor entity."""
424  super().__init__(coordinator, entity_description, property_id)
425 
426  if entity_description.device_class == SensorDeviceClass.ENUM:
427  self._attr_options_attr_options = self.datadatadatadata.options
428 
429  def _update_status(self) -> None:
430  """Update status itself."""
431  super()._update_status()
432 
433  self._attr_native_value_attr_native_value = self.datadatadatadata.value
434 
435  if (data_unit := self._get_unit_of_measurement_get_unit_of_measurement(self.datadatadatadata.unit)) is not None:
436  # For different from description's unit
437  self._attr_native_unit_of_measurement_attr_native_unit_of_measurement = data_unit
438 
439  _LOGGER.debug(
440  "[%s:%s] update status: %s -> %s, options:%s, unit:%s",
441  self.coordinator.device_name,
442  self.property_idproperty_id,
443  self.datadatadatadata.value,
444  self.native_valuenative_value,
445  self.optionsoptions,
446  self.native_unit_of_measurementnative_unit_of_measurement,
447  )
str|None _get_unit_of_measurement(self, str|None unit)
Definition: entity.py:73
None __init__(self, DeviceDataUpdateCoordinator coordinator, SensorEntityDescription entity_description, str property_id)
Definition: sensor.py:422
StateType|date|datetime|Decimal native_value(self)
Definition: __init__.py:460
None async_setup_entry(HomeAssistant hass, ThinqConfigEntry entry, AddEntitiesCallback async_add_entities)
Definition: sensor.py:385