From 1244e8d72788bbd9b3bf2838d61ce220f667800d Mon Sep 17 00:00:00 2001 From: Gertjan Date: Wed, 20 Jul 2022 17:25:50 +0200 Subject: [PATCH] Fixed issue with deprecated number methods --- custom_components/myenergi/number.py | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/custom_components/myenergi/number.py b/custom_components/myenergi/number.py index e4edfaa..6856111 100644 --- a/custom_components/myenergi/number.py +++ b/custom_components/myenergi/number.py @@ -53,25 +53,25 @@ def name(self): return f"myenergi {self.device.name} Heater Priority" @property - def value(self): + def native_value(self): """Return the state of the sensor.""" return self.device.heater_priority - async def async_set_value(self, value: float) -> None: + async def async_set_native_value(self, value: float) -> None: """Change the selected option.""" await self.device.set_heater_priority(f"heater{int(value)}") self.async_schedule_update_ha_state() @property - def min_value(self): + def native_min_value(self): return 1 @property - def max_value(self): + def native_max_value(self): return 2 @property - def step(self): + def native_step(self): return 1 @@ -99,11 +99,11 @@ def name(self): return f"myenergi {self.device.name} Device Priority" @property - def value(self): + def native_value(self): """Return the state of the sensor.""" return self.device.priority - async def async_set_value(self, value: float) -> None: + async def async_set_native_value(self, value: float) -> None: """Change the selected option.""" await self.device.set_priority(int(value)) self.async_schedule_update_ha_state() @@ -114,15 +114,15 @@ def icon(self): return "mdi:sort-numeric-variant" @property - def min_value(self): + def native_min_value(self): return 1 @property - def max_value(self): + def native_max_value(self): return 10 @property - def step(self): + def native_step(self): return 1 @@ -153,23 +153,23 @@ def icon(self): return "mdi:leaf" @property - def value(self): + def native_value(self): """Return the state of the sensor.""" return self.device.minimum_green_level - async def async_set_value(self, value: float) -> None: + async def async_set_native_value(self, value: float) -> None: """Change the selected option.""" await self.device.set_minimum_green_level(int(value)) self.async_schedule_update_ha_state() @property - def min_value(self): + def native_min_value(self): return 0 @property - def max_value(self): + def native_max_value(self): return 100 @property - def step(self): + def native_step(self): return 1