Fix on/off when setting level

This commit is contained in:
Scott Shawcroft 2024-10-23 15:24:01 -07:00
parent 5bea854fbb
commit 2ba0c814bc
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -15,7 +15,7 @@ from . import session
from .subscription import Subscription
from .device_types.utility.root_node import RootNode
__version__ = "0.3.0"
__version__ = "0.3.1"
class CircuitMatter:

View file

@ -24,6 +24,10 @@ class DimmableLight(OnOffLight):
except Exception as e:
print(f"Error setting brightness: {e}")
return
if self._level_control.min_level == value.Level:
self._on_off.OnOff = False
else:
self._on_off.OnOff = True
self._level_control.CurrentLevel = value.Level
@property