diff --git a/homeassistant/components/sofar/sensor.py b/homeassistant/components/sofar/sensor.py index a22103bccc58..7c582eedf407 100644 --- a/homeassistant/components/sofar/sensor.py +++ b/homeassistant/components/sofar/sensor.py @@ -138,8 +138,6 @@ class SofarTotalSensor(SofarEntity, RestoreSensor): except ValueError, TypeError: return self._attr_native_value = val - if (total_fn := self.entity_description.total_fn) is not None: - total_fn(self.coordinator.device).seed(val) @property @override diff --git a/tests/components/sofar/test_sensor.py b/tests/components/sofar/test_sensor.py index 64dddf701ad3..15051e62b3a2 100644 --- a/tests/components/sofar/test_sensor.py +++ b/tests/components/sofar/test_sensor.py @@ -302,32 +302,6 @@ async def test_total_sensor_restore_data_parsing( assert unset_sensor.native_value is None -async def test_total_sensor_seeds_high_water_from_restored_value( - hass: HomeAssistant, init_integration: MockConfigEntry -) -> None: - """Test a restored value seeds the library's high-water mark.""" - runtime_data = init_integration.runtime_data - device = runtime_data.readings.device - description = SofarSensorDescription( - key="load_consumption_total", - component="meter_energy", - translation_key="load_consumption_total", - state_class=SensorStateClass.TOTAL_INCREASING, - value_fn=lambda device: ( - device.meter_energy.load_consumption_total_corrected.value - ), - total_fn=lambda device: device.meter_energy.load_consumption_total_corrected, - ) - sensor = SofarTotalSensor(runtime_data, description) - sensor.hass = hass - sensor.async_get_last_sensor_data = AsyncMock( - return_value=SimpleNamespace(native_value="555.5") - ) - with patch.object(device.meter_energy, "seed_high_water") as mock_seed: - await sensor.async_added_to_hass() - mock_seed.assert_called_once_with("load_consumption_total", 555.5) - - async def test_sensor_dead_link_unavailable(init_integration: MockConfigEntry) -> None: """Test SofarSensor.available is False when the last update failed.""" runtime_data = init_integration.runtime_data