diff --git a/custom_components/aton_storage/sensor.py b/custom_components/aton_storage/sensor.py index 8760b1f..cf6aaea 100644 --- a/custom_components/aton_storage/sensor.py +++ b/custom_components/aton_storage/sensor.py @@ -136,7 +136,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @callback def _handle_coordinator_update(self) -> None: """Handle updated data from the coordinator.""" - self._attr_native_value = self.coordinator.api.status.current_battery_status + self._attr_native_value = self.coordinator.api.status.battery_status self.async_write_ha_state() @@ -174,7 +174,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: self._attr_unique_id = "aton_home_" + coordinator.api.username def update(self) -> None: - self._attr_native_value = self.coordinator.api.status.current_house_consumption + self._attr_native_value = self.coordinator.api.status.house_consumption class BatteryPower(BasePowerSensor): @@ -186,7 +186,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: self._attr_unique_id = "aton_battery_power_" + coordinator.api.username def update(self) -> None: - self._attr_native_value = self.coordinator.api.status.current_battery_power + self._attr_native_value = self.coordinator.api.status.battery_power class SolarProduction(BasePowerSensor): @@ -198,7 +198,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: self._attr_unique_id = "aton_solar_power_" + coordinator.api.username def update(self) -> None: - self._attr_native_value = self.coordinator.api.status.current_solar_production + self._attr_native_value = self.coordinator.api.status.solar_production class GridPower(BasePowerSensor): @@ -210,7 +210,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: self._attr_unique_id = "aton_grid_power_" + coordinator.api.username def update(self) -> None: - self._attr_native_value = self.coordinator.api.status.current_grid_power + self._attr_native_value = self.coordinator.api.status.grid_power class BaseBinarySensor(BinarySensorEntity, CoordinatorEntity): @@ -246,7 +246,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.grid_to_house + return self.coordinator.api.status.is_grid_to_house class SolarToBattery(BaseBinarySensor): @@ -259,7 +259,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.solar_to_battery + return self.coordinator.api.status.is_solar_to_battery class SolarToGrid(BaseBinarySensor): @@ -272,7 +272,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.solar_to_grid + return self.coordinator.api.status.is_solar_to_grid class BatteryToHouse(BaseBinarySensor): @@ -285,7 +285,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.battery_to_house + return self.coordinator.api.status.is_battery_to_house class SolarToHouse(BaseBinarySensor): @@ -298,7 +298,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.solar_to_house + return self.coordinator.api.status.is_solar_to_house class GridToBattery(BaseBinarySensor): @@ -311,7 +311,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.grid_to_battery + return self.coordinator.api.status.is_grid_to_battery class BatteryToGrid(BaseBinarySensor): @@ -324,7 +324,7 @@ def __init__(self, coordinator: ApiCoordinator) -> None: @property def is_on(self) -> bool: - return self.coordinator.api.status.battery_to_grid + return self.coordinator.api.status.is_battery_to_grid class BaseEnergySensor(SensorEntity, CoordinatorEntity):