Skip to content

Commit

Permalink
Fix max_value access for number platform in Overkiz (home-assistant#7…
Browse files Browse the repository at this point in the history
…3479)

Fix wrong property name
  • Loading branch information
tetienne authored and balloob committed Jun 14, 2022
1 parent d8f2afb commit 0b22e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/overkiz/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def value(self) -> float | None:
"""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)

Expand All @@ -143,7 +143,7 @@ def value(self) -> float | None:
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
Expand Down

0 comments on commit 0b22e47

Please sign in to comment.