From 2c75abc2f5cada0bf52b75eeb137109a1801ae6a Mon Sep 17 00:00:00 2001 From: Anarion Date: Tue, 17 Sep 2024 11:24:22 +0200 Subject: [PATCH] :bug: Fix missing atttributes in some sensors Fixes [Bug]: Fan percentage (txtid) is missing unit of measure #112 --- custom_components/tech/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/tech/sensor.py b/custom_components/tech/sensor.py index 906a180..06b046e 100644 --- a/custom_components/tech/sensor.py +++ b/custom_components/tech/sensor.py @@ -1331,7 +1331,7 @@ def device_info(self): return None -class TileFuelSupplySensor(TileSensor): +class TileFuelSupplySensor(TileSensor, SensorEntity): """Representation of a Tile Fuel Supply Sensor.""" _attr_native_unit_of_measurement = PERCENTAGE @@ -1357,7 +1357,7 @@ def get_state(self, device): return device[CONF_PARAMS]["percentage"] -class TileFanSensor(TileSensor): +class TileFanSensor(TileSensor, SensorEntity): """Representation of a Tile Fan Sensor.""" _attr_native_unit_of_measurement = PERCENTAGE @@ -1383,7 +1383,7 @@ def get_state(self, device): return device[CONF_PARAMS]["gear"] -class TileTextSensor(TileSensor): +class TileTextSensor(TileSensor, SensorEntity): """Representation of a Tile Text Sensor.""" def __init__(self, device, coordinator, config_entry): @@ -1412,7 +1412,7 @@ def get_state(self, device): return assets.get_text(device[CONF_PARAMS]["statusId"]) -class TileWidgetSensor(TileSensor): +class TileWidgetSensor(TileSensor, SensorEntity): """Representation of a Tile Widget Sensor.""" _attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS