Skip to content

Commit

Permalink
Fix on/off when setting level
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt committed Oct 23, 2024
1 parent 5bea854 commit 2ba0c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion circuitmatter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .subscription import Subscription
from .device_types.utility.root_node import RootNode

__version__ = "0.3.0"
__version__ = "0.3.1"


class CircuitMatter:
Expand Down
4 changes: 4 additions & 0 deletions circuitmatter/device_types/lighting/dimmable.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def _move_to_level_with_on_off(self, session, value):
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
Expand Down

0 comments on commit 2ba0c81

Please sign in to comment.