"""Register definitions for Victron MPPT Solar Charger (unit ID 223)."""

from .base import DeviceParser, RegisterDefinition, RegisterType


class SolarChargerParser(DeviceParser):
    """Parser for MPPT solar charger registers."""

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

    @property
    def product_name(self) -> str:
        return "Victron MPPT Solar Charger"

    @property
    def registers(self) -> tuple[RegisterDefinition, ...]:
        return (
            RegisterDefinition("battery_voltage", 771, scale=100),
            RegisterDefinition("battery_current", 772, RegisterType.INT16, scale=10),
            RegisterDefinition("charger_state", 775),
            RegisterDefinition("pv_voltage", 776, scale=100),
            RegisterDefinition("pv_current", 777, RegisterType.INT16, scale=10),
            RegisterDefinition("yield_today", 784, scale=10),
            RegisterDefinition("max_charge_power_today", 785),
            RegisterDefinition("pv_power", 789, scale=10),
        )
