mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Update entity names for P1 Monitor integration (#55430)
This commit is contained in:
parent
94e0db8ec4
commit
6823b14d4c
@ -3,7 +3,7 @@
|
|||||||
"name": "P1 Monitor",
|
"name": "P1 Monitor",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/p1_monitor",
|
"documentation": "https://www.home-assistant.io/integrations/p1_monitor",
|
||||||
"requirements": ["p1monitor==0.2.0"],
|
"requirements": ["p1monitor==1.0.0"],
|
||||||
"codeowners": ["@klaasnicolaas"],
|
"codeowners": ["@klaasnicolaas"],
|
||||||
"quality_scale": "platinum",
|
"quality_scale": "platinum",
|
||||||
"iot_class": "local_polling"
|
"iot_class": "local_polling"
|
||||||
|
@ -192,33 +192,33 @@ SENSORS: dict[
|
|||||||
),
|
),
|
||||||
SERVICE_SETTINGS: (
|
SERVICE_SETTINGS: (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="gas_consumption_tariff",
|
key="gas_consumption_price",
|
||||||
name="Gas Consumption - Tariff",
|
name="Gas Consumption Price",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
device_class=DEVICE_CLASS_MONETARY,
|
device_class=DEVICE_CLASS_MONETARY,
|
||||||
native_unit_of_measurement=CURRENCY_EURO,
|
native_unit_of_measurement=CURRENCY_EURO,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_consumption_low_tariff",
|
key="energy_consumption_price_low",
|
||||||
name="Energy Consumption - Low Tariff",
|
name="Energy Consumption Price - Low",
|
||||||
device_class=DEVICE_CLASS_MONETARY,
|
device_class=DEVICE_CLASS_MONETARY,
|
||||||
native_unit_of_measurement=CURRENCY_EURO,
|
native_unit_of_measurement=CURRENCY_EURO,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_consumption_high_tariff",
|
key="energy_consumption_price_high",
|
||||||
name="Energy Consumption - High Tariff",
|
name="Energy Consumption Price - High",
|
||||||
device_class=DEVICE_CLASS_MONETARY,
|
device_class=DEVICE_CLASS_MONETARY,
|
||||||
native_unit_of_measurement=CURRENCY_EURO,
|
native_unit_of_measurement=CURRENCY_EURO,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_production_low_tariff",
|
key="energy_production_price_low",
|
||||||
name="Energy Production - Low Tariff",
|
name="Energy Production Price - Low",
|
||||||
device_class=DEVICE_CLASS_MONETARY,
|
device_class=DEVICE_CLASS_MONETARY,
|
||||||
native_unit_of_measurement=CURRENCY_EURO,
|
native_unit_of_measurement=CURRENCY_EURO,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="energy_production_high_tariff",
|
key="energy_production_price_high",
|
||||||
name="Energy Production - High Tariff",
|
name="Energy Production Price - High",
|
||||||
device_class=DEVICE_CLASS_MONETARY,
|
device_class=DEVICE_CLASS_MONETARY,
|
||||||
native_unit_of_measurement=CURRENCY_EURO,
|
native_unit_of_measurement=CURRENCY_EURO,
|
||||||
),
|
),
|
||||||
|
@ -1139,7 +1139,7 @@ orvibo==1.1.1
|
|||||||
ovoenergy==1.1.12
|
ovoenergy==1.1.12
|
||||||
|
|
||||||
# homeassistant.components.p1_monitor
|
# homeassistant.components.p1_monitor
|
||||||
p1monitor==0.2.0
|
p1monitor==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.mqtt
|
# homeassistant.components.mqtt
|
||||||
# homeassistant.components.shiftr
|
# homeassistant.components.shiftr
|
||||||
|
@ -641,7 +641,7 @@ openerz-api==0.1.0
|
|||||||
ovoenergy==1.1.12
|
ovoenergy==1.1.12
|
||||||
|
|
||||||
# homeassistant.components.p1_monitor
|
# homeassistant.components.p1_monitor
|
||||||
p1monitor==0.2.0
|
p1monitor==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.mqtt
|
# homeassistant.components.mqtt
|
||||||
# homeassistant.components.shiftr
|
# homeassistant.components.shiftr
|
||||||
|
@ -151,23 +151,23 @@ async def test_settings(
|
|||||||
entity_registry = er.async_get(hass)
|
entity_registry = er.async_get(hass)
|
||||||
device_registry = dr.async_get(hass)
|
device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
state = hass.states.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_low_tariff")
|
entry = entity_registry.async_get("sensor.monitor_energy_consumption_price_low")
|
||||||
assert entry
|
assert entry
|
||||||
assert state
|
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.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_DEVICE_CLASS) == DEVICE_CLASS_MONETARY
|
||||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO
|
||||||
|
|
||||||
state = hass.states.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_low_tariff")
|
entry = entity_registry.async_get("sensor.monitor_energy_production_price_low")
|
||||||
assert entry
|
assert entry
|
||||||
assert state
|
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.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_DEVICE_CLASS) == DEVICE_CLASS_MONETARY
|
||||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENCY_EURO
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user