Skip to content

Commit

Permalink
Update x3_hybrid_g4.py
Browse files Browse the repository at this point in the history
refactor battery_modes to _decode_battery_mode
  • Loading branch information
SebStaeubert authored Mar 7, 2024
1 parent bb619e5 commit 8d2da9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solax/inverters/x3_hybrid_g4.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ def _decode_run_mode(cls, run_mode):
}.get(run_mode)

@classmethod
def battery_modes(value):
def _decode_battery_mode(cls, battery_mode):
return {
0: "Self Use Mode",
1: "Force Time Use",
2: "Back Up Mode",
3: "Feed-in Priority",
}.get(value, f"unmapped value '{value}'")
}.get(battery_mode)

@classmethod
def response_decoder(cls):
Expand Down Expand Up @@ -124,7 +124,7 @@ def response_decoder(cls):
"Battery Temperature": (105, Units.C, to_signed),
"Battery Remaining Energy": (106, Units.KWH, div10),
"Battery mode": (168, Units.NONE),
"Battery mode text": (168, Units.NONE, X3HybridG4.battery_mode),
"Battery mode text": (168, Units.NONE, X3HybridG4._decode_battery_mode),
"Battery Voltage": (pack_u16(169, 170), Units.V, div100),
}

Expand Down

0 comments on commit 8d2da9d

Please sign in to comment.