diff --git a/homeassistant/components/kostal_plenticore/const.py b/homeassistant/components/kostal_plenticore/const.py index ba850ed58bd..11bb794f799 100644 --- a/homeassistant/components/kostal_plenticore/const.py +++ b/homeassistant/components/kostal_plenticore/const.py @@ -818,10 +818,10 @@ NUMBER_SETTINGS_DATA = [ entity_registry_enabled_default=False, icon="mdi:battery-negative", name="Battery min SoC", - unit_of_measurement=PERCENTAGE, - max_value=100, - min_value=5, - step=5, + native_unit_of_measurement=PERCENTAGE, + native_max_value=100, + native_min_value=5, + native_step=5, module_id="devices:local", data_id="Battery:MinSoc", fmt_from="format_round", @@ -833,10 +833,10 @@ NUMBER_SETTINGS_DATA = [ entity_category=EntityCategory.CONFIG, entity_registry_enabled_default=False, name="Battery min Home Consumption", - unit_of_measurement=POWER_WATT, - max_value=38000, - min_value=50, - step=1, + native_unit_of_measurement=POWER_WATT, + native_max_value=38000, + native_min_value=50, + native_step=1, module_id="devices:local", data_id="Battery:MinHomeComsumption", fmt_from="format_round", diff --git a/homeassistant/components/kostal_plenticore/number.py b/homeassistant/components/kostal_plenticore/number.py index 33d431d6396..1ad911f6d15 100644 --- a/homeassistant/components/kostal_plenticore/number.py +++ b/homeassistant/components/kostal_plenticore/number.py @@ -105,9 +105,9 @@ class PlenticoreDataNumber(CoordinatorEntity, NumberEntity, ABC): # overwrite from retrieved setting data if setting_data.min is not None: - self._attr_min_value = self._formatter(setting_data.min) + self._attr_native_min_value = self._formatter(setting_data.min) if setting_data.max is not None: - self._attr_max_value = self._formatter(setting_data.max) + self._attr_native_max_value = self._formatter(setting_data.max) @property def module_id(self) -> str: @@ -140,7 +140,7 @@ class PlenticoreDataNumber(CoordinatorEntity, NumberEntity, ABC): await super().async_will_remove_from_hass() @property - def value(self) -> float | None: + def native_value(self) -> float | None: """Return the current value.""" if self.available: raw_value = self.coordinator.data[self.module_id][self.data_id] @@ -148,7 +148,7 @@ class PlenticoreDataNumber(CoordinatorEntity, NumberEntity, ABC): return None - async def async_set_value(self, value: float) -> None: + async def async_set_native_value(self, value: float) -> None: """Set a new value.""" str_value = self._formatter_back(value) await self.coordinator.async_write_data( diff --git a/tests/components/kostal_plenticore/test_number.py b/tests/components/kostal_plenticore/test_number.py index 43d693642d9..f0fb42f6e78 100644 --- a/tests/components/kostal_plenticore/test_number.py +++ b/tests/components/kostal_plenticore/test_number.py @@ -31,8 +31,8 @@ def mock_number_description() -> PlenticoreNumberEntityDescription: key="mock key", module_id="moduleid", data_id="dataid", - min_value=0, - max_value=1000, + native_min_value=0, + native_max_value=1000, fmt_from="format_round", fmt_to="format_round_back", ) @@ -136,7 +136,7 @@ async def test_set_value( mock_coordinator, "42", "scb", None, mock_number_description, mock_setting_data ) - await entity.async_set_value(42) + await entity.async_set_native_value(42) mock_coordinator.async_write_data.assert_called_once_with( "moduleid", {"dataid": "42"}