Skip to content

Commit

Permalink
update state & device class for sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
gvigroux committed Oct 4, 2024
1 parent 6eb5408 commit d3fd3e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/hon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://github.com/gvigroux/hon",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/gvigroux/hon/issues",
"version": "0.7.9"
"version": "0.7.10"
}
6 changes: 4 additions & 2 deletions custom_components/hon/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,17 @@ class HonBaseTemperature(HonBaseSensorEntity):
def __init__(self, hass, coordinator, entry, appliance, key, name) -> None:
super().__init__(coordinator, appliance, key, name)

self._attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
self._attr_state_class = SensorStateClass.MEASUREMENT
self._attr_device_class = SensorDeviceClass.TEMPERATURE
self._attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS


class HonBaseHumidity(HonBaseSensorEntity):
def __init__(self, hass, coordinator, entry, appliance, zone = "Z1", zone_name = "Zone 1") -> None:
super().__init__(coordinator, appliance, "humidity" + zone, f"Humidity {zone_name}")

self._attr_device_class = SensorDeviceClass.HUMIDITY
self._attr_state_class = SensorStateClass.MEASUREMENT
self._attr_device_class = SensorDeviceClass.HUMIDITY
self._attr_native_unit_of_measurement = PERCENTAGE
self._attr_icon = "mdi:water-percent"

Expand All @@ -234,6 +235,7 @@ class HonBaseRemainingTime(HonBaseSensorEntity):
def __init__(self, hass, coordinator, entry, appliance) -> None:
super().__init__(coordinator, appliance, "remainingTimeMM", "Remaining time")

self._attr_state_class = SensorStateClass.MEASUREMENT
self._attr_native_unit_of_measurement = UnitOfTime.MINUTES
self._attr_device_class = SensorDeviceClass.DURATION
self._attr_icon = "mdi:progress-clock"
Expand Down

0 comments on commit d3fd3e1

Please sign in to comment.