Fix matter exception NoneType in set_brightness for optional min/max level values (#95949)

Fix exception NoneType in set_brightness for optional min/max level values
This commit is contained in:
neocolis 2023-07-06 08:50:51 -04:00 committed by GitHub
parent be01eb5aad
commit 63cb50977b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ class MatterLight(MatterEntity, LightEntity):
renormalize( renormalize(
brightness, brightness,
(0, 255), (0, 255),
(level_control.minLevel, level_control.maxLevel), (level_control.minLevel or 1, level_control.maxLevel or 254),
) )
) )
@ -220,7 +220,7 @@ class MatterLight(MatterEntity, LightEntity):
return round( return round(
renormalize( renormalize(
level_control.currentLevel, 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), (0, 255),
) )
) )