diff --git a/homeassistant/components/powerwall/sensor.py b/homeassistant/components/powerwall/sensor.py index 24aeb9e4f4e..9e17cd32e9c 100644 --- a/homeassistant/components/powerwall/sensor.py +++ b/homeassistant/components/powerwall/sensor.py @@ -113,12 +113,6 @@ POWERWALL_INSTANT_SENSORS = ( ) -def _get_battery_charge(battery_data: BatteryResponse) -> float: - """Get the current value in %.""" - ratio = float(battery_data.energy_remaining) / float(battery_data.capacity) - return round(100 * ratio, 1) - - BATTERY_INSTANT_SENSORS: list[PowerwallSensorEntityDescription] = [ PowerwallSensorEntityDescription[BatteryResponse, int]( key="battery_capacity", @@ -202,16 +196,6 @@ BATTERY_INSTANT_SENSORS: list[PowerwallSensorEntityDescription] = [ suggested_display_precision=1, value_fn=lambda battery_data: battery_data.energy_remaining, ), - PowerwallSensorEntityDescription[BatteryResponse, float]( - key="charge", - translation_key="charge", - entity_category=EntityCategory.DIAGNOSTIC, - state_class=SensorStateClass.MEASUREMENT, - device_class=SensorDeviceClass.BATTERY, - native_unit_of_measurement=PERCENTAGE, - suggested_display_precision=0, - value_fn=_get_battery_charge, - ), PowerwallSensorEntityDescription[BatteryResponse, str]( key="grid_state", translation_key="grid_state", diff --git a/tests/components/powerwall/test_sensor.py b/tests/components/powerwall/test_sensor.py index 11b4f25e4a3..2de79a6a6dc 100644 --- a/tests/components/powerwall/test_sensor.py +++ b/tests/components/powerwall/test_sensor.py @@ -157,7 +157,6 @@ async def test_sensors( float(hass.states.get("sensor.mysite_tg0123456789ab_battery_remaining").state) == 14.715 ) - assert float(hass.states.get("sensor.mysite_tg0123456789ab_charge").state) == 100.0 assert ( str(hass.states.get("sensor.mysite_tg0123456789ab_grid_state").state) == "grid_compliant" @@ -187,7 +186,6 @@ async def test_sensors( float(hass.states.get("sensor.mysite_tg9876543210ba_battery_remaining").state) == 15.137 ) - assert float(hass.states.get("sensor.mysite_tg9876543210ba_charge").state) == 100.0 assert ( str(hass.states.get("sensor.mysite_tg9876543210ba_grid_state").state) == "grid_compliant"