from data_gateway_sdk.protocols.smpm.smpm_ul_device_jupiter_12b_counter_volume import \
    SmpmUlDeviceJupiter12BCounterVolumeData
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_ul_device_jupiter_12b_counter_volume() -> None:
    case_serialized = bytes.fromhex("d5f9fffffffbffffff43d61d00000000")
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=2147483.647, volume_channel_2=2147483.647, battery_volts=2.0, temperature=23, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=2147483.647, volume_channel_2=2147483.647, battery_volts=2.0, temperature=23, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000f81f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=0.0, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000f81f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=0.0, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000f81f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=8589934.592, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000f81f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=8589934.592, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000001c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=0.0, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000001c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=0.0, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000001c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=8589934.592, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d5010000000000000000001c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=0.0, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=0.0, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=8589934.592, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0ff1f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=0.0, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0ff1f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=0.0, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0ff1f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=8589934.592, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0ff1f00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=92, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=92, volume_channel_1=8589934.592, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0071c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=0.0, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0071c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=0.0, volume_channel_2=8589934.592))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0071c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=8589934.592, volume_channel_2=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("d50100000000000000f0071c00000000")  # overflow
    assert SmpmUlDeviceJupiter12BCounterVolumeData(volume_channel_1=0.0, volume_channel_2=0.0, battery_volts=2.54, temperature=-35, event_reset=True, event_low_battery_level=True, event_low_ambient_temperature=True) == SmpmUlDeviceJupiter12BCounterVolumeData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceJupiter12BCounterVolumeData.serialize(SmpmUlDeviceJupiter12BCounterVolumeData(battery_volts=2.54, event_low_ambient_temperature=True, event_low_battery_level=True, event_reset=True, temperature=-35, volume_channel_1=8589934.592, volume_channel_2=8589934.592))  # noqa: E501
