Fix max_value access for number platform in Overkiz (#73479)

Fix wrong property name
pull/73504/head
Thibaut 2022-06-14 15:17:40 +02:00 committed by Paulus Schoutsen
parent d8f2afb772
commit 0b22e47c53
1 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ class OverkizNumber(OverkizDescriptiveEntity, NumberEntity):
"""Return the entity value to represent the entity state."""
if state := self.device.states.get(self.entity_description.key):
if self.entity_description.inverted:
return self._attr_max_value - cast(float, state.value)
return self.max_value - cast(float, state.value)
return cast(float, state.value)
@ -143,7 +143,7 @@ class OverkizNumber(OverkizDescriptiveEntity, NumberEntity):
async def async_set_value(self, value: float) -> None:
"""Set new value."""
if self.entity_description.inverted:
value = self._attr_max_value - value
value = self.max_value - value
await self.executor.async_execute_command(
self.entity_description.command, value