Skip to content

Commit

Permalink
resolve ruff check errors for newly introduced registers
Browse files Browse the repository at this point in the history
  • Loading branch information
sfstar committed Feb 3, 2025
1 parent 5482d3a commit aa7ad5d
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions custom_components/victron/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ class vebus_error(Enum):


class vebus_charger_state(Enum):
"""Vebus charger state."""

INITIALIZING = 0
BULK = 1
ABSORPTION = 2
Expand Down Expand Up @@ -610,6 +612,8 @@ class vebus_charger_state(Enum):


class battery_mode(Enum):
"""Battery mode."""

OPEN = 0
STANDBY = 14

Expand Down Expand Up @@ -875,11 +879,15 @@ class battery_error(Enum):


class battery_mode_alternative(Enum):
"""Battery mode alternative."""

ON = 3
STANDBY = 252


class battery_balancer_status(Enum):
"""Battery balancer status."""

UNKNOWN = 0
BALANCED = 1
BALANCING = 2
Expand Down Expand Up @@ -1339,6 +1347,8 @@ class charger_mode(Enum):


class acinput_source(Enum):
"""AC input source."""

UNUSED = 0
GRID = 1
GENSET = 2
Expand Down Expand Up @@ -2035,9 +2045,6 @@ class generator_error(Enum):
dataType=UINT16,
entityType=TextReadEntityType(generic_alarm_ledger),
),
"generator_autostartenabled": RegisterInfo(
register=3509, dataType=UINT16, entityType=SwitchWriteType()
),
"generator_autostartenabled": RegisterInfo(
3509, UINT16, entityType=SwitchWriteType()
),
Expand Down Expand Up @@ -2261,6 +2268,8 @@ class alternator_errorcode(Enum):


class alternator_mode(Enum):
"""Alternator mode."""

ON = 1
OFF = 4

Expand Down Expand Up @@ -2751,10 +2760,7 @@ class multi_input_type(Enum):
dataType=UINT16,
entityType=TextReadEntityType(generic_alarm_ledger),
),
"multi_alarm_lowsoc": RegisterInfo(
4602, UINT16, entityType=TextReadEntityType(generic_alarm_ledger)
),
"multi_yield_user": RegisterInfo(4603, UINT32, UnitOfEnergy.KILO_WATT_HOUR),
"multi_yield_user_2": RegisterInfo(4603, UINT32, UnitOfEnergy.KILO_WATT_HOUR),
"multi_mppoperationmode_0": RegisterInfo(
4605, UINT16, entityType=TextReadEntityType(generic_mppoperationmode)
),
Expand Down Expand Up @@ -2786,11 +2792,15 @@ class multi_input_type(Enum):


class pump_state(Enum):
"""Pump state."""

STOPPED = 0
RUNNING = 1


class pump_mode(Enum):
"""Pump mode."""

AUTO = 0
ON = 1
OFF = 2
Expand All @@ -2810,6 +2820,8 @@ class pump_mode(Enum):


class dcdc_errorcode(Enum):
"""DCDC error codes."""

NO_ERROR = 0
BATTERY_TEMPERATURE_TOO_HIGH = 1
BATTERY_VOLTAGE_TOO_HIGH = 2
Expand All @@ -2830,11 +2842,15 @@ class dcdc_errorcode(Enum):


class dcdc_mode(Enum):
"""DCDC mode."""

ON = 1
OFF = 4


class dcdc_state(Enum):
"""DCDC state."""

OFF = 0
FAULT = 2
BULK = 3
Expand Down Expand Up @@ -2869,6 +2885,8 @@ class dcdc_state(Enum):


class acsystem_state(Enum):
"""AC system state."""

OFF = 0
LOW_POWER = 1
FAULT = 2
Expand Down Expand Up @@ -3005,6 +3023,8 @@ class acsystem_state(Enum):


class dynamic_ess_error(Enum):
"""Dynamic ESS error codes."""

NO_ERROR = 0
NO_ESS = 1
ESS_MODE = 2
Expand All @@ -3014,13 +3034,17 @@ class dynamic_ess_error(Enum):


class dynamic_ess_restrictions(Enum):
"""Dynamic ESS restrictions."""

NO_RESTRICTIONS_BETWEEN_BATTERY_AND_GRID = 0
GRID_TO_BATTERY_RESTRICTED = 1
BATTERY_TO_GRID_RESTRICTED = 2
NO_ENERGY_FLOW_BETWEEN_BATTERY_AND_GRID = 3


class dynamic_ess_strategy(Enum):
"""Dynamic ESS strategy."""

TARGET_SOC = 0
SELF_CONSUMPTION = 1

Expand Down Expand Up @@ -3052,6 +3076,8 @@ class dynamic_ess_strategy(Enum):


class dynamic_ess_mode(Enum):
"""Dynamic ESS mode."""

OFF = 0
AUTO = 1
NODE_RED = 4
Expand Down

0 comments on commit aa7ad5d

Please sign in to comment.