Skip to content

Commit

Permalink
Refactor sensor definitions to use SelectRWSensor for Priority Load, …
Browse files Browse the repository at this point in the history
…Passive Grid Balance, and Active Grid Balance with appropriate options and bitmasks
  • Loading branch information
maslyankov committed Jan 3, 2025
1 parent 4c25fcf commit ef0b419
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/sunsynk/definitions/three_phase_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,35 @@
# System program
#################

SENSORS += SwitchRWSensor(141, "Priority Load")
SENSORS += (
SelectRWSensor(
141,
"Priority Load",
options={
0b10 << 0: "Battery First",
0b11 << 0: "Load First",
},
bitmask=0b11 << 0,
),
SelectRWSensor(
141,
"Passive Grid Balance",
options={
0b10 << 2: "Close",
0b11 << 2: "Open",
},
bitmask=0b11 << 2,
),
SelectRWSensor(
141,
"Active Grid Balance",
options={
0b10 << 4: "Close",
0b11 << 4: "Open",
},
bitmask=0b11 << 4,
),
)

SENSORS += SelectRWSensor(
142,
Expand Down

0 comments on commit ef0b419

Please sign in to comment.