Skip to content

Commit

Permalink
Fix wrong field names
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaPatarca committed Nov 18, 2022
1 parent 101fe4e commit 3354047
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions custom_components/aton_storage/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit 3354047

Please sign in to comment.