Update entity names for P1 Monitor integration (#55430)

This commit is contained in:
Klaas Schoute 2021-08-30 05:29:37 +02:00 committed by GitHub
parent 94e0db8ec4
commit 6823b14d4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 21 deletions

View File

@ -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"

View File

@ -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,
),

View File

@ -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

View File

@ -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

View File

@ -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