from datetime import timedelta

from data_gateway_sdk.protocols.smpm.smpm_ul_device_energy_16b_status_info import SmpmUlDeviceEnergy16BStatusInfoData
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_ul_device_energy_16b_status_info() -> None:
    case_serialized = bytes.fromhex("bd03f8ac0e013eabc3d05e0000000000")
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=567648000.0), uptime_s=timedelta(seconds=567648000.0), battery_volts=3.3, temperature=23, relay_switch=1, relay_is_active=False) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=567648000.0), uptime_s=timedelta(seconds=567648000.0), battery_volts=3.3, temperature=23, relay_switch=1, relay_is_active=False))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000000c03f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000000c03f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd030000000000000000000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd030000000000000000000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000000c0ff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000000c0ff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd030000000000000000c00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd030000000000000000c00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000000c03f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000000c03f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff0100000000000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff0100000000000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000000c0ff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000000c0ff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff0100000000c00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff0100000000c00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=0.0, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=0.0, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000080ff3f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000080ff3f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd03000000000000803f000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd03000000000000803f000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000080ffff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd0300000000000080ffff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd03000000000000803fc00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bd03000000000000803fc00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=0.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=0.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000080ff3f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000080ff3f0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff010000803f000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff010000803f000100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=0, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=0, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000080ffff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff01000080ffff0100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=155, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=155, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff010000803fc00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=0.0)))  # noqa: E501
    case_serialized = bytes.fromhex("bdfbffffff010000803fc00100000000")  # overflow
    assert SmpmUlDeviceEnergy16BStatusInfoData(date_time=timedelta(seconds=1073741823.0), uptime_s=timedelta(seconds=0.0), battery_volts=12.7, temperature=-100, relay_switch=3, relay_is_active=True) == SmpmUlDeviceEnergy16BStatusInfoData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BStatusInfoData.serialize(SmpmUlDeviceEnergy16BStatusInfoData(battery_volts=12.7, date_time=timedelta(seconds=1073741823.0), relay_is_active=True, relay_switch=3, temperature=-100, uptime_s=timedelta(seconds=2147483648.0)))  # noqa: E501
