"""Register definitions for Victron System (unit ID 100)."""

from .base import DeviceParser, RegisterDefinition, RegisterType


class SystemParser(DeviceParser):
    """Parser for system-level registers on the Cerbo GX."""

    @property
    def device_type(self) -> str:
        return "system"

    @property
    def product_name(self) -> str:
        return "Victron System"

    @property
    def registers(self) -> tuple[RegisterDefinition, ...]:
        return (
            RegisterDefinition("grid_power_l1", 817, RegisterType.INT16),
            RegisterDefinition("ac_consumption_l1", 820),
            RegisterDefinition("battery_voltage", 840, scale=10),
            RegisterDefinition("battery_current", 841, RegisterType.INT16, scale=10),
            RegisterDefinition("battery_power", 842, RegisterType.INT16),
            RegisterDefinition("battery_soc", 843),
            RegisterDefinition("battery_state", 844),
            RegisterDefinition("pv_power", 850),
        )
