mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add icon translations to Huisbaasje (#111726)
* Add icon translations to Huisbaasje * Add icon translations to Huisbaasje
This commit is contained in:
parent
e28f551cb0
commit
c957ff49bf
21
homeassistant/components/huisbaasje/icons.json
Normal file
21
homeassistant/components/huisbaasje/icons.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"current_gas": {
|
||||||
|
"default": "mdi:meter-gas"
|
||||||
|
},
|
||||||
|
"gas_today": {
|
||||||
|
"default": "mdi:meter-gas"
|
||||||
|
},
|
||||||
|
"gas_week": {
|
||||||
|
"default": "mdi:meter-gas"
|
||||||
|
},
|
||||||
|
"gas_month": {
|
||||||
|
"default": "mdi:meter-gas"
|
||||||
|
},
|
||||||
|
"gas_year": {
|
||||||
|
"default": "mdi:meter-gas"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -64,7 +64,6 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
key=SOURCE_TYPE_ELECTRICITY,
|
key=SOURCE_TYPE_ELECTRICITY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="current_power_peak",
|
translation_key="current_power_peak",
|
||||||
@ -73,7 +72,6 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
key=SOURCE_TYPE_ELECTRICITY_IN,
|
key=SOURCE_TYPE_ELECTRICITY_IN,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="current_power_off_peak",
|
translation_key="current_power_off_peak",
|
||||||
@ -82,7 +80,6 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
key=SOURCE_TYPE_ELECTRICITY_IN_LOW,
|
key=SOURCE_TYPE_ELECTRICITY_IN_LOW,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="current_power_out_peak",
|
translation_key="current_power_out_peak",
|
||||||
@ -91,7 +88,6 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
key=SOURCE_TYPE_ELECTRICITY_OUT,
|
key=SOURCE_TYPE_ELECTRICITY_OUT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="current_power_out_off_peak",
|
translation_key="current_power_out_off_peak",
|
||||||
@ -100,7 +96,6 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
key=SOURCE_TYPE_ELECTRICITY_OUT_LOW,
|
key=SOURCE_TYPE_ELECTRICITY_OUT_LOW,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_consumption_peak_today",
|
translation_key="energy_consumption_peak_today",
|
||||||
@ -110,7 +105,6 @@ SENSORS_INFO = [
|
|||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=3,
|
precision=3,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_consumption_off_peak_today",
|
translation_key="energy_consumption_off_peak_today",
|
||||||
@ -120,7 +114,6 @@ SENSORS_INFO = [
|
|||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=3,
|
precision=3,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_production_peak_today",
|
translation_key="energy_production_peak_today",
|
||||||
@ -130,7 +123,6 @@ SENSORS_INFO = [
|
|||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=3,
|
precision=3,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_production_off_peak_today",
|
translation_key="energy_production_off_peak_today",
|
||||||
@ -140,7 +132,6 @@ SENSORS_INFO = [
|
|||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
precision=3,
|
precision=3,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_today",
|
translation_key="energy_today",
|
||||||
@ -150,7 +141,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_ELECTRICITY,
|
key=SOURCE_TYPE_ELECTRICITY,
|
||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
precision=1,
|
precision=1,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_week",
|
translation_key="energy_week",
|
||||||
@ -160,7 +150,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_ELECTRICITY,
|
key=SOURCE_TYPE_ELECTRICITY,
|
||||||
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
||||||
precision=1,
|
precision=1,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_month",
|
translation_key="energy_month",
|
||||||
@ -170,7 +159,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_ELECTRICITY,
|
key=SOURCE_TYPE_ELECTRICITY,
|
||||||
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
||||||
precision=1,
|
precision=1,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="energy_year",
|
translation_key="energy_year",
|
||||||
@ -180,7 +168,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_ELECTRICITY,
|
key=SOURCE_TYPE_ELECTRICITY,
|
||||||
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
||||||
precision=1,
|
precision=1,
|
||||||
icon="mdi:lightning-bolt",
|
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
translation_key="current_gas",
|
translation_key="current_gas",
|
||||||
@ -188,7 +175,6 @@ SENSORS_INFO = [
|
|||||||
sensor_type=SENSOR_TYPE_RATE,
|
sensor_type=SENSOR_TYPE_RATE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
icon="mdi:fire",
|
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
@ -198,7 +184,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
@ -208,7 +193,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
@ -218,7 +202,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
HuisbaasjeSensorEntityDescription(
|
HuisbaasjeSensorEntityDescription(
|
||||||
@ -228,7 +211,6 @@ SENSORS_INFO = [
|
|||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -9,7 +9,6 @@ from homeassistant.components.sensor import (
|
|||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_DEVICE_CLASS,
|
ATTR_DEVICE_CLASS,
|
||||||
ATTR_ICON,
|
|
||||||
ATTR_UNIT_OF_MEASUREMENT,
|
ATTR_UNIT_OF_MEASUREMENT,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_PASSWORD,
|
CONF_PASSWORD,
|
||||||
@ -59,7 +58,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert (
|
assert (
|
||||||
current_power.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
|
current_power.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
|
||||||
)
|
)
|
||||||
assert current_power.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
current_power.attributes.get(ATTR_STATE_CLASS)
|
current_power.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.MEASUREMENT
|
is SensorStateClass.MEASUREMENT
|
||||||
@ -74,7 +72,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
current_power_in.attributes.get(ATTR_DEVICE_CLASS)
|
current_power_in.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.POWER
|
== SensorDeviceClass.POWER
|
||||||
)
|
)
|
||||||
assert current_power_in.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
current_power_in.attributes.get(ATTR_STATE_CLASS)
|
current_power_in.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.MEASUREMENT
|
is SensorStateClass.MEASUREMENT
|
||||||
@ -90,7 +87,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
current_power_in_low.attributes.get(ATTR_DEVICE_CLASS)
|
current_power_in_low.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.POWER
|
== SensorDeviceClass.POWER
|
||||||
)
|
)
|
||||||
assert current_power_in_low.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
current_power_in_low.attributes.get(ATTR_STATE_CLASS)
|
current_power_in_low.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.MEASUREMENT
|
is SensorStateClass.MEASUREMENT
|
||||||
@ -106,7 +102,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
current_power_out.attributes.get(ATTR_DEVICE_CLASS)
|
current_power_out.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.POWER
|
== SensorDeviceClass.POWER
|
||||||
)
|
)
|
||||||
assert current_power_out.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
current_power_out.attributes.get(ATTR_STATE_CLASS)
|
current_power_out.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.MEASUREMENT
|
is SensorStateClass.MEASUREMENT
|
||||||
@ -122,7 +117,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
current_power_out_low.attributes.get(ATTR_DEVICE_CLASS)
|
current_power_out_low.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.POWER
|
== SensorDeviceClass.POWER
|
||||||
)
|
)
|
||||||
assert current_power_out_low.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
current_power_out_low.attributes.get(ATTR_STATE_CLASS)
|
current_power_out_low.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.MEASUREMENT
|
is SensorStateClass.MEASUREMENT
|
||||||
@ -140,10 +134,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_consumption_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
energy_consumption_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert (
|
|
||||||
energy_consumption_peak_today.attributes.get(ATTR_ICON)
|
|
||||||
== "mdi:lightning-bolt"
|
|
||||||
)
|
|
||||||
assert (
|
assert (
|
||||||
energy_consumption_peak_today.attributes.get(ATTR_STATE_CLASS)
|
energy_consumption_peak_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -161,10 +151,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_consumption_off_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
energy_consumption_off_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert (
|
|
||||||
energy_consumption_off_peak_today.attributes.get(ATTR_ICON)
|
|
||||||
== "mdi:lightning-bolt"
|
|
||||||
)
|
|
||||||
assert (
|
assert (
|
||||||
energy_consumption_off_peak_today.attributes.get(ATTR_STATE_CLASS)
|
energy_consumption_off_peak_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -182,10 +168,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_production_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
energy_production_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert (
|
|
||||||
energy_production_peak_today.attributes.get(ATTR_ICON)
|
|
||||||
== "mdi:lightning-bolt"
|
|
||||||
)
|
|
||||||
assert (
|
assert (
|
||||||
energy_production_peak_today.attributes.get(ATTR_STATE_CLASS)
|
energy_production_peak_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -203,10 +185,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_production_off_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
energy_production_off_peak_today.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert (
|
|
||||||
energy_production_off_peak_today.attributes.get(ATTR_ICON)
|
|
||||||
== "mdi:lightning-bolt"
|
|
||||||
)
|
|
||||||
assert (
|
assert (
|
||||||
energy_production_off_peak_today.attributes.get(ATTR_STATE_CLASS)
|
energy_production_off_peak_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -221,7 +199,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert (
|
assert (
|
||||||
energy_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
energy_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert energy_today.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert energy_today.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
assert energy_today.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
||||||
assert (
|
assert (
|
||||||
energy_today.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
energy_today.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
@ -234,7 +211,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_this_week.attributes.get(ATTR_DEVICE_CLASS)
|
energy_this_week.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert energy_this_week.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
energy_this_week.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
energy_this_week.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
||||||
)
|
)
|
||||||
@ -249,7 +225,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_this_month.attributes.get(ATTR_DEVICE_CLASS)
|
energy_this_month.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert energy_this_month.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
energy_this_month.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
energy_this_month.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
||||||
)
|
)
|
||||||
@ -264,7 +239,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
energy_this_year.attributes.get(ATTR_DEVICE_CLASS)
|
energy_this_year.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
== SensorDeviceClass.ENERGY
|
== SensorDeviceClass.ENERGY
|
||||||
)
|
)
|
||||||
assert energy_this_year.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
|
|
||||||
assert (
|
assert (
|
||||||
energy_this_year.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
energy_this_year.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
||||||
)
|
)
|
||||||
@ -276,7 +250,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
current_gas = hass.states.get("sensor.current_gas")
|
current_gas = hass.states.get("sensor.current_gas")
|
||||||
assert current_gas.state == "0.0"
|
assert current_gas.state == "0.0"
|
||||||
assert current_gas.attributes.get(ATTR_DEVICE_CLASS) is None
|
assert current_gas.attributes.get(ATTR_DEVICE_CLASS) is None
|
||||||
assert current_gas.attributes.get(ATTR_ICON) == "mdi:fire"
|
|
||||||
assert (
|
assert (
|
||||||
current_gas.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
current_gas.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
||||||
)
|
)
|
||||||
@ -288,7 +261,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
gas_today = hass.states.get("sensor.gas_today")
|
gas_today = hass.states.get("sensor.gas_today")
|
||||||
assert gas_today.state == "1.1"
|
assert gas_today.state == "1.1"
|
||||||
assert gas_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_today.attributes.get(ATTR_ICON) == "mdi:counter"
|
|
||||||
assert (
|
assert (
|
||||||
gas_today.attributes.get(ATTR_STATE_CLASS)
|
gas_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -301,7 +273,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
gas_this_week = hass.states.get("sensor.gas_this_week")
|
gas_this_week = hass.states.get("sensor.gas_this_week")
|
||||||
assert gas_this_week.state == "5.6"
|
assert gas_this_week.state == "5.6"
|
||||||
assert gas_this_week.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_week.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_week.attributes.get(ATTR_ICON) == "mdi:counter"
|
|
||||||
assert (
|
assert (
|
||||||
gas_this_week.attributes.get(ATTR_STATE_CLASS)
|
gas_this_week.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -314,7 +285,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
gas_this_month = hass.states.get("sensor.gas_this_month")
|
gas_this_month = hass.states.get("sensor.gas_this_month")
|
||||||
assert gas_this_month.state == "39.1"
|
assert gas_this_month.state == "39.1"
|
||||||
assert gas_this_month.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_month.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_month.attributes.get(ATTR_ICON) == "mdi:counter"
|
|
||||||
assert (
|
assert (
|
||||||
gas_this_month.attributes.get(ATTR_STATE_CLASS)
|
gas_this_month.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
@ -327,7 +297,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
gas_this_year = hass.states.get("sensor.gas_this_year")
|
gas_this_year = hass.states.get("sensor.gas_this_year")
|
||||||
assert gas_this_year.state == "116.7"
|
assert gas_this_year.state == "116.7"
|
||||||
assert gas_this_year.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_year.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_year.attributes.get(ATTR_ICON) == "mdi:counter"
|
|
||||||
assert (
|
assert (
|
||||||
gas_this_year.attributes.get(ATTR_STATE_CLASS)
|
gas_this_year.attributes.get(ATTR_STATE_CLASS)
|
||||||
is SensorStateClass.TOTAL_INCREASING
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
|
Loading…
x
Reference in New Issue
Block a user