Skip to content

Commit

Permalink
Déplacer l'assignation de l'icon après l'init de IntegrationSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
maxyvon committed Apr 4, 2024
1 parent 5eb6f64 commit e368124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/hilo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class EnergySensor(IntegrationSensor):
_attr_native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
_attr_state_class = SensorStateClass.TOTAL_INCREASING
_attr_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
_attr_icon = "mdi:lightning-bolt"

def __init__(self, hilo, device):
self._device = device
Expand Down Expand Up @@ -291,6 +290,7 @@ def __init__(self, hilo, device):
unit_time="h",
device_info=self._device_info,
)
self._attr_icon = "mdi:lightning-bolt"
LOG.debug(
f"Setting up EnergySensor entity: {self._attr_name} with source {self._source}"
)
Expand Down

0 comments on commit e368124

Please sign in to comment.