Skip to content

Commit

Permalink
fix: Enum and select bit lookup w/ single mode
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Dec 18, 2024
1 parent 146b528 commit 24ce03f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/solarman/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def lookup_value(value, dictionary):
for o in dictionary:
key = from_bit_index(o["bit"]) if "bit" in o else o["key"]

if o.get("mode") == "single" and value & key == key:
key = value

if "default" in o or key == "default":
default = o["value"]

Expand Down

0 comments on commit 24ce03f

Please sign in to comment.