Skip to content

Commit

Permalink
Fix exception NoneType in set_brightness for optional min/max level v…
Browse files Browse the repository at this point in the history
…alues
  • Loading branch information
Christopher Ferrer committed Jul 6, 2023
1 parent cb7fa49 commit 8e68b30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/matter/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async def _set_brightness(self, brightness: int) -> None:
renormalize(
brightness,
(0, 255),
(level_control.minLevel, level_control.maxLevel),
(level_control.minLevel or 1, level_control.maxLevel or 254),
)
)

Expand Down Expand Up @@ -220,7 +220,7 @@ def _get_brightness(self) -> int:
return round(
renormalize(
level_control.currentLevel,
(level_control.minLevel or 0, level_control.maxLevel or 254),
(level_control.minLevel or 1, level_control.maxLevel or 254),
(0, 255),
)
)
Expand Down

0 comments on commit 8e68b30

Please sign in to comment.