Skip to content

Commit

Permalink
fix: TOU entity stays enabled when disabled - Deye
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Dec 13, 2024
1 parent 592b84b commit 05cacfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,9 @@ parameters:
- key: 0x00C1
value: "Weekend"
- key: 0x00FF
default:
value: "Week"
- bit: 0
mode: single
value: "Enabled"

- name: "Program 1 Time"
Expand Down
4 changes: 3 additions & 1 deletion custom_components/solarman/inverter_definitions/deye_p3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,9 @@ parameters:
- key: 0x00C1
value: "Weekend"
- key: 0x00FF
default:
value: "Week"
- bit: 0
mode: single
value: "Enabled"

- name: Program 1 Time
Expand Down
2 changes: 1 addition & 1 deletion custom_components/solarman/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_key(self, value: str):
if self.dictionary:
for o in self.dictionary:
if o["value"] == value and (key := from_bit_index(o["bit"]) if "bit" in o else o["key"]) is not None:
return key if not self.mask else self._attr_value & (0xFFFFFFFF - self.mask) | key
return (key if not "mode" in o else (self._attr_value | key)) if not self.mask else (self._attr_value & (0xFFFFFFFF - self.mask) | key)

return self.options.index(value)

Expand Down

0 comments on commit 05cacfd

Please sign in to comment.