From 32c416b646c459125503687723b6db600ef158d0 Mon Sep 17 00:00:00 2001 From: rhpijnacker Date: Wed, 5 Jan 2022 22:50:00 +0100 Subject: [PATCH] Bump dsmr-parser dependency to 0.32 (#63436) --- homeassistant/components/dsmr/const.py | 42 +++++---------------- homeassistant/components/dsmr/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/dsmr/test_sensor.py | 16 ++++---- 5 files changed, 20 insertions(+), 44 deletions(-) diff --git a/homeassistant/components/dsmr/const.py b/homeassistant/components/dsmr/const.py index a8c4de930df..11bab06daba 100644 --- a/homeassistant/components/dsmr/const.py +++ b/homeassistant/components/dsmr/const.py @@ -241,42 +241,18 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = ( state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, ), - DSMRSensorEntityDescription( - key=obis_references.LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL, - name="Energy Consumption (total)", - dsmr_versions={"5L"}, - force_update=True, - device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, - ), - DSMRSensorEntityDescription( - key=obis_references.LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL, - name="Energy Production (total)", - dsmr_versions={"5L"}, - force_update=True, - device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, - ), - DSMRSensorEntityDescription( - key=obis_references.SWEDEN_ELECTRICITY_USED_TARIFF_GLOBAL, - name="Energy Consumption (total)", - dsmr_versions={"5S"}, - force_update=True, - device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, - ), - DSMRSensorEntityDescription( - key=obis_references.SWEDEN_ELECTRICITY_DELIVERED_TARIFF_GLOBAL, - name="Energy Production (total)", - dsmr_versions={"5S"}, - force_update=True, - device_class=SensorDeviceClass.ENERGY, - state_class=SensorStateClass.TOTAL_INCREASING, - ), DSMRSensorEntityDescription( key=obis_references.ELECTRICITY_IMPORTED_TOTAL, name="Energy Consumption (total)", - dsmr_versions={"2.2", "4", "5", "5B"}, + dsmr_versions={"5", "5B", "5L", "5S"}, + force_update=True, + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + DSMRSensorEntityDescription( + key=obis_references.ELECTRICITY_EXPORTED_TOTAL, + name="Energy Production (total)", + dsmr_versions={"5L", "5S"}, force_update=True, device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, diff --git a/homeassistant/components/dsmr/manifest.json b/homeassistant/components/dsmr/manifest.json index 5cc935f1708..d89c5a74db1 100644 --- a/homeassistant/components/dsmr/manifest.json +++ b/homeassistant/components/dsmr/manifest.json @@ -2,7 +2,7 @@ "domain": "dsmr", "name": "DSMR Slimme Meter", "documentation": "https://www.home-assistant.io/integrations/dsmr", - "requirements": ["dsmr_parser==0.31"], + "requirements": ["dsmr_parser==0.32"], "codeowners": ["@Robbie1221", "@frenck"], "config_flow": true, "iot_class": "local_push" diff --git a/requirements_all.txt b/requirements_all.txt index 4b5bdb15914..9cb1759abcf 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -569,7 +569,7 @@ doorbirdpy==2.1.0 dovado==0.4.1 # homeassistant.components.dsmr -dsmr_parser==0.31 +dsmr_parser==0.32 # homeassistant.components.dwd_weather_warnings dwdwfsapi==1.0.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7bffe023ffa..f3f0795841b 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -364,7 +364,7 @@ directv==0.4.0 doorbirdpy==2.1.0 # homeassistant.components.dsmr -dsmr_parser==0.31 +dsmr_parser==0.32 # homeassistant.components.dynalite dynalite_devices==0.1.46 diff --git a/tests/components/dsmr/test_sensor.py b/tests/components/dsmr/test_sensor.py index b0b1f9c1183..ff8c2e6a94f 100644 --- a/tests/components/dsmr/test_sensor.py +++ b/tests/components/dsmr/test_sensor.py @@ -309,9 +309,9 @@ async def test_luxembourg_meter(hass, dsmr_connection_fixture): (connection_factory, transport, protocol) = dsmr_connection_fixture from dsmr_parser.obis_references import ( + ELECTRICITY_EXPORTED_TOTAL, + ELECTRICITY_IMPORTED_TOTAL, HOURLY_GAS_METER_READING, - LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL, - LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL, ) from dsmr_parser.objects import CosemObject, MBusObject @@ -334,10 +334,10 @@ async def test_luxembourg_meter(hass, dsmr_connection_fixture): {"value": Decimal(745.695), "unit": "m3"}, ] ), - LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL: CosemObject( + ELECTRICITY_IMPORTED_TOTAL: CosemObject( [{"value": Decimal(123.456), "unit": ENERGY_KILO_WATT_HOUR}] ), - LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL: CosemObject( + ELECTRICITY_EXPORTED_TOTAL: CosemObject( [{"value": Decimal(654.321), "unit": ENERGY_KILO_WATT_HOUR}] ), } @@ -510,8 +510,8 @@ async def test_swedish_meter(hass, dsmr_connection_fixture): (connection_factory, transport, protocol) = dsmr_connection_fixture from dsmr_parser.obis_references import ( - SWEDEN_ELECTRICITY_DELIVERED_TARIFF_GLOBAL, - SWEDEN_ELECTRICITY_USED_TARIFF_GLOBAL, + ELECTRICITY_EXPORTED_TOTAL, + ELECTRICITY_IMPORTED_TOTAL, ) from dsmr_parser.objects import CosemObject @@ -528,10 +528,10 @@ async def test_swedish_meter(hass, dsmr_connection_fixture): } telegram = { - SWEDEN_ELECTRICITY_USED_TARIFF_GLOBAL: CosemObject( + ELECTRICITY_IMPORTED_TOTAL: CosemObject( [{"value": Decimal(123.456), "unit": ENERGY_KILO_WATT_HOUR}] ), - SWEDEN_ELECTRICITY_DELIVERED_TARIFF_GLOBAL: CosemObject( + ELECTRICITY_EXPORTED_TOTAL: CosemObject( [{"value": Decimal(654.321), "unit": ENERGY_KILO_WATT_HOUR}] ), }