mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Yolink diagnostic sensors (#160749)
This commit is contained in:
@@ -212,6 +212,7 @@ SENSOR_TYPES: tuple[YoLinkSensorEntityDescription, ...] = (
|
||||
key="battery",
|
||||
device_class=SensorDeviceClass.BATTERY,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
exists_fn=lambda device: device.device_type in BATTERY_POWER_SENSOR,
|
||||
should_update_entity=lambda value: value is not None,
|
||||
@@ -251,9 +252,11 @@ SENSOR_TYPES: tuple[YoLinkSensorEntityDescription, ...] = (
|
||||
# mcu temperature
|
||||
YoLinkSensorEntityDescription(
|
||||
key="devTemperature",
|
||||
translation_key="device_temperature",
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
exists_fn=lambda device: device.device_type in MCU_DEV_TEMPERATURE_SENSOR,
|
||||
should_update_entity=lambda value: value is not None,
|
||||
value=lambda device, data: data.get("devTemperature"),
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
"current_power": {
|
||||
"name": "Current power"
|
||||
},
|
||||
"device_temperature": {
|
||||
"name": "Device temperature"
|
||||
},
|
||||
"power_consumption": {
|
||||
"name": "Power consumption"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user