"""Constants for the Lithionics Li3 BMS integration.""" DOMAIN = "li3_battery" # (key, name, unit, device_class, display_precision) -- precision None means a # non-numeric value (hex code, version string, serial number): published as-is, # no rounding, no state_class. Mirrors van-li3-battery's SENSORS list. SENSORS = [ ("voltage", "Pack Voltage", "V", "voltage", 2), ("cell1_voltage", "Cell 1 Voltage", "V", "voltage", 2), ("cell2_voltage", "Cell 2 Voltage", "V", "voltage", 2), ("cell3_voltage", "Cell 3 Voltage", "V", "voltage", 2), ("cell4_voltage", "Cell 4 Voltage", "V", "voltage", 2), ("current", "Current", "A", "current", 2), ("soc", "State of Charge", "%", "battery", 0), ("bms_temperature", "BMS Temperature", "°F", "temperature", 1), ("battery_temperature", "Battery Temperature", "°F", "temperature", 1), ("remaining_capacity", "Remaining Capacity", "Ah", None, 0), ("remaining_time", "Remaining Time", "min", "duration", 0), ("can_charger_voltage", "CAN Charger Voltage", "V", "voltage", 1), ("can_charger_current", "CAN Charger Current", "A", "current", 1), ("can_charger_status", "CAN Charger Status", None, None, None), ("can_status", "CAN Status", None, None, None), ] # From the one-time "$info" response -- published as diagnostic entities. INFO_SENSORS = [ ("total_consumed", "Lifetime Consumed", "Ah", None, 0), ("last_fault_code", "Last Fault Code", None, None, None), ("highest_recorded_temp", "Highest Recorded Temperature", "°F", "temperature", 0), ("lowest_recorded_temp", "Lowest Recorded Temperature", "°F", "temperature", 0), ("firmware_version", "Firmware Version", None, None, None), ("aging_factor_temp", "Aging Factor (Temp)", None, None, 0), ("aging_factor_soc", "Aging Factor (SOC)", None, None, 0), ("serial_number", "Serial Number", None, None, None), ]