From 6823b14d4cbe282f6182b224491b436aba4ec209 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Mon, 30 Aug 2021 05:29:37 +0200 Subject: [PATCH] Update entity names for P1 Monitor integration (#55430) --- .../components/p1_monitor/manifest.json | 2 +- homeassistant/components/p1_monitor/sensor.py | 20 +++++++++---------- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/p1_monitor/test_sensor.py | 16 +++++++-------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/homeassistant/components/p1_monitor/manifest.json b/homeassistant/components/p1_monitor/manifest.json index 1a4beb36f5d..00b50bb029b 100644 --- a/homeassistant/components/p1_monitor/manifest.json +++ b/homeassistant/components/p1_monitor/manifest.json @@ -3,7 +3,7 @@ "name": "P1 Monitor", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/p1_monitor", - "requirements": ["p1monitor==0.2.0"], + "requirements": ["p1monitor==1.0.0"], "codeowners": ["@klaasnicolaas"], "quality_scale": "platinum", "iot_class": "local_polling" diff --git a/homeassistant/components/p1_monitor/sensor.py b/homeassistant/components/p1_monitor/sensor.py index 36a991c7333..ea18854f748 100644 --- a/homeassistant/components/p1_monitor/sensor.py +++ b/homeassistant/components/p1_monitor/sensor.py @@ -192,33 +192,33 @@ SENSORS: dict[ ), SERVICE_SETTINGS: ( SensorEntityDescription( - key="gas_consumption_tariff", - name="Gas Consumption - Tariff", + key="gas_consumption_price", + name="Gas Consumption Price", entity_registry_enabled_default=False, device_class=DEVICE_CLASS_MONETARY, native_unit_of_measurement=CURRENCY_EURO, ), SensorEntityDescription( - key="energy_consumption_low_tariff", - name="Energy Consumption - Low Tariff", + key="energy_consumption_price_low", + name="Energy Consumption Price - Low", device_class=DEVICE_CLASS_MONETARY, native_unit_of_measurement=CURRENCY_EURO, ), SensorEntityDescription( - key="energy_consumption_high_tariff", - name="Energy Consumption - High Tariff", + key="energy_consumption_price_high", + name="Energy Consumption Price - High", device_class=DEVICE_CLASS_MONETARY, native_unit_of_measurement=CURRENCY_EURO, ), SensorEntityDescription( - key="energy_production_low_tariff", - name="Energy Production - Low Tariff", + key="energy_production_price_low", + name="Energy Production Price - Low", device_class=DEVICE_CLASS_MONETARY, native_unit_of_measurement=CURRENCY_EURO, ), SensorEntityDescription( - key="energy_production_high_tariff", - name="Energy Production - High Tariff", + key="energy_production_price_high", + name="Energy Production Price - High", device_class=DEVICE_CLASS_MONETARY, native_unit_of_measurement=CURRENCY_EURO, ), diff --git a/requirements_all.txt b/requirements_all.txt index 9a2b1c033a9..889f35954b0 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1139,7 +1139,7 @@ orvibo==1.1.1 ovoenergy==1.1.12 # homeassistant.components.p1_monitor -p1monitor==0.2.0 +p1monitor==1.0.0 # homeassistant.components.mqtt # homeassistant.components.shiftr diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 28a2a7b8e3c..1335dbd8185 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -641,7 +641,7 @@ openerz-api==0.1.0 ovoenergy==1.1.12 # homeassistant.components.p1_monitor -p1monitor==0.2.0 +p1monitor==1.0.0 # homeassistant.components.mqtt # homeassistant.components.shiftr diff --git a/tests/components/p1_monitor/test_sensor.py b/tests/components/p1_monitor/test_sensor.py index baf73811636..90733ce8941 100644 --- a/tests/components/p1_monitor/test_sensor.py +++ b/tests/components/p1_monitor/test_sensor.py @@ -151,23 +151,23 @@ async def test_settings( entity_registry = er.async_get(hass) device_registry = dr.async_get(hass) - state = hass.states.get("sensor.monitor_energy_consumption_low_tariff") - entry = entity_registry.async_get("sensor.monitor_energy_consumption_low_tariff") + state = hass.states.get("sensor.monitor_energy_consumption_price_low") + entry = entity_registry.async_get("sensor.monitor_energy_consumption_price_low") assert entry assert state - assert entry.unique_id == f"{entry_id}_settings_energy_consumption_low_tariff" + assert entry.unique_id == f"{entry_id}_settings_energy_consumption_price_low" assert state.state == "0.20522" - assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Energy Consumption - Low Tariff" + assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Energy Consumption Price - Low" assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_MONETARY assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO - state = hass.states.get("sensor.monitor_energy_production_low_tariff") - entry = entity_registry.async_get("sensor.monitor_energy_production_low_tariff") + state = hass.states.get("sensor.monitor_energy_production_price_low") + entry = entity_registry.async_get("sensor.monitor_energy_production_price_low") assert entry assert state - assert entry.unique_id == f"{entry_id}_settings_energy_production_low_tariff" + assert entry.unique_id == f"{entry_id}_settings_energy_production_price_low" assert state.state == "0.20522" - assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Energy Production - Low Tariff" + assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Energy Production Price - Low" assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_MONETARY assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO