Skip to content

Commit

Permalink
Merge pull request #188 from sfstar/feature/add_low_temperature_senso…
Browse files Browse the repository at this point in the history
…r_battery_state_as_decodable_value

add enum support for battery powered temp sensors
  • Loading branch information
sfstar authored Mar 17, 2024
2 parents a23d4c3 + 0cc1ccf commit c9c696e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/victron/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,21 @@ class temperature_type(Enum):
FRIDGE = 1
GENERIC = 2

class temperature_status(Enum):
OK = 0
DISCONNECTED = 1
SHORT_CIRCUITED = 2
REVERSE_POLARITY = 3
UNKNOWN = 4
LOW_BATTERY = 5

temperature_registers = {
"temperature_productid": RegisterInfo(3300, UINT16),
"temperature_scale": RegisterInfo(3301, UINT16, "", 100),
"temperature_offset": RegisterInfo(3302, INT16, "",100),
"temperature_type": RegisterInfo(register=3303, dataType=UINT16, entityType=TextReadEntityType(temperature_type)),
"temperature_temperature": RegisterInfo(3304, INT16, UnitOfTemperature.CELSIUS, 100),
"temperature_status": RegisterInfo(register=3305, dataType=UINT16, entityType=TextReadEntityType(generic_status)),
"temperature_status": RegisterInfo(register=3305, dataType=UINT16, entityType=TextReadEntityType(temperature_status)),
"temperature_humidity": RegisterInfo(3306, UINT16, PERCENTAGE, 10),
"temperature_batteryvoltage": RegisterInfo(3307, UINT16, UnitOfElectricPotential.VOLT, 100),
"temperature_pressure": RegisterInfo(3308, UINT16, UnitOfPressure.HPA)
Expand Down

0 comments on commit c9c696e

Please sign in to comment.