from data_gateway_sdk.protocols.smpm.smpm_ul_device_water_meter_08b_daily_new import \
    SmpmUlDeviceWaterMeter08BDailyNewData
from data_gateway_sdk.utils.buf_ref import BufRef


def test_smpm_ul_device_water_meter_08b_daily_new() -> None:
    case_serialized = bytes.fromhex("74e4eab1d6858f87")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=112323.3, temperature=23, battery_volts=3.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=False, value_reverse=1.084) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(value=112323.3, temperature=23, battery_volts=3.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=False, value_reverse=1111.1))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8031f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=0.0, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8031f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=0.0, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8031f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=268435.456, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8031f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=268435.456, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000001f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=0.0, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000001f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=0.0, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000001f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=268435.456, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000001f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=0.0, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=0.0, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=268435.456, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8ff1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=0.0, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8ff1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=0.0, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8ff1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=268435.456, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("74000000f8ff1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=92, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=92, value=268435.456, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000fc1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=0.0, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000fc1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=0.0, value_reverse=4.096))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000fc1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=268435.456, value_reverse=0.0))  # noqa: E501
    case_serialized = bytes.fromhex("7400000000fc1f00")  # overflow
    assert SmpmUlDeviceWaterMeter08BDailyNewData(value=0.0, temperature=-35, battery_volts=6.3, event_low_battery_level=True, event_temperature_limits=True, event_reset=True, event_magnet=True, event_reverse_flow=True, value_reverse=0.0) == SmpmUlDeviceWaterMeter08BDailyNewData.parse(BufRef(case_serialized))  # noqa: E501
    assert case_serialized == SmpmUlDeviceWaterMeter08BDailyNewData.serialize(SmpmUlDeviceWaterMeter08BDailyNewData(battery_volts=6.3, event_low_battery_level=True, event_magnet=True, event_reset=True, event_reverse_flow=True, event_temperature_limits=True, temperature=-35, value=268435.456, value_reverse=4.096))  # noqa: E501
