from data_gateway_sdk.protocols.smpm.smpm_ul_device_energy_16b_retrospective_energy import SmpmUlDeviceEnergy16BRetrospectiveEnergyData, SmpmUlDeviceEnergy16bRetrospectiveEnergyIds
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_ul_device_energy_16b_retrospective_energy() -> None:
    case_serialized = bytes.fromhex("90f3188e67432784000000c0eebd0b00")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=False, period_ago=15, value_current=285591.16, value_previous_1_delta=5413.0, value_previous_2_delta=0.0, value_previous_3_delta=123123.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=False, period_ago=15, value_current=4312123.0, value_previous_1_delta=5413.0, value_previous_2_delta=0.0, value_previous_3_delta=123123.0))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("900bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("90fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.DAILY_ENERGY_ACTIVE_CONSUMED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10b0000000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a10bfeffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=0, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=0, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fb0100000000000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=0.0, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=0.0, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=0.0, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=0.0, value_previous_3_delta=335544.32))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("a1fbffffff0f00000000000000000000")  # overflow
    assert SmpmUlDeviceEnergy16BRetrospectiveEnergyData(packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, is_valid=True, period_ago=31, value_current=1342177.27, value_previous_1_delta=0.0, value_previous_2_delta=0.0, value_previous_3_delta=0.0) == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceEnergy16BRetrospectiveEnergyData.serialize(SmpmUlDeviceEnergy16BRetrospectiveEnergyData(is_valid=True, packet_type_id_enum=SmpmUlDeviceEnergy16bRetrospectiveEnergyIds.MONTHLY_ENERGY_REACTIVE_GENERATED, period_ago=31, value_current=2684354.55, value_previous_1_delta=335544.32, value_previous_2_delta=335544.32, value_previous_3_delta=335544.32))  # noqa: E501
