Add icon translations to Huisbaasje (#111726)

* Add icon translations to Huisbaasje

* Add icon translations to Huisbaasje
pull/111736/head
Joost Lekkerkerker 2024-02-28 16:37:14 +01:00 committed by GitHub
parent e28f551cb0
commit c957ff49bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 49 deletions

View 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"
}
}
}
}

View File

@ -64,7 +64,6 @@ SENSORS_INFO = [
native_unit_of_measurement=UnitOfPower.WATT,
key=SOURCE_TYPE_ELECTRICITY,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="current_power_peak",
@ -73,7 +72,6 @@ SENSORS_INFO = [
native_unit_of_measurement=UnitOfPower.WATT,
key=SOURCE_TYPE_ELECTRICITY_IN,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="current_power_off_peak",
@ -82,7 +80,6 @@ SENSORS_INFO = [
native_unit_of_measurement=UnitOfPower.WATT,
key=SOURCE_TYPE_ELECTRICITY_IN_LOW,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="current_power_out_peak",
@ -91,7 +88,6 @@ SENSORS_INFO = [
native_unit_of_measurement=UnitOfPower.WATT,
key=SOURCE_TYPE_ELECTRICITY_OUT,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="current_power_out_off_peak",
@ -100,7 +96,6 @@ SENSORS_INFO = [
native_unit_of_measurement=UnitOfPower.WATT,
key=SOURCE_TYPE_ELECTRICITY_OUT_LOW,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_consumption_peak_today",
@ -110,7 +105,6 @@ SENSORS_INFO = [
sensor_type=SENSOR_TYPE_THIS_DAY,
state_class=SensorStateClass.TOTAL_INCREASING,
precision=3,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_consumption_off_peak_today",
@ -120,7 +114,6 @@ SENSORS_INFO = [
sensor_type=SENSOR_TYPE_THIS_DAY,
state_class=SensorStateClass.TOTAL_INCREASING,
precision=3,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_production_peak_today",
@ -130,7 +123,6 @@ SENSORS_INFO = [
sensor_type=SENSOR_TYPE_THIS_DAY,
state_class=SensorStateClass.TOTAL_INCREASING,
precision=3,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_production_off_peak_today",
@ -140,7 +132,6 @@ SENSORS_INFO = [
sensor_type=SENSOR_TYPE_THIS_DAY,
state_class=SensorStateClass.TOTAL_INCREASING,
precision=3,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_today",
@ -150,7 +141,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_DAY,
precision=1,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_week",
@ -160,7 +150,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_WEEK,
precision=1,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_month",
@ -170,7 +159,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_MONTH,
precision=1,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="energy_year",
@ -180,7 +168,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_ELECTRICITY,
sensor_type=SENSOR_TYPE_THIS_YEAR,
precision=1,
icon="mdi:lightning-bolt",
),
HuisbaasjeSensorEntityDescription(
translation_key="current_gas",
@ -188,7 +175,6 @@ SENSORS_INFO = [
sensor_type=SENSOR_TYPE_RATE,
state_class=SensorStateClass.MEASUREMENT,
key=SOURCE_TYPE_GAS,
icon="mdi:fire",
precision=1,
),
HuisbaasjeSensorEntityDescription(
@ -198,7 +184,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_GAS,
sensor_type=SENSOR_TYPE_THIS_DAY,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
precision=1,
),
HuisbaasjeSensorEntityDescription(
@ -208,7 +193,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_GAS,
sensor_type=SENSOR_TYPE_THIS_WEEK,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
precision=1,
),
HuisbaasjeSensorEntityDescription(
@ -218,7 +202,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_GAS,
sensor_type=SENSOR_TYPE_THIS_MONTH,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
precision=1,
),
HuisbaasjeSensorEntityDescription(
@ -228,7 +211,6 @@ SENSORS_INFO = [
key=SOURCE_TYPE_GAS,
sensor_type=SENSOR_TYPE_THIS_YEAR,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
precision=1,
),
]

View File

@ -9,7 +9,6 @@ from homeassistant.components.sensor import (
)
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
CONF_ID,
CONF_PASSWORD,
@ -59,7 +58,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert (
current_power.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
)
assert current_power.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
current_power.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
@ -74,7 +72,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
current_power_in.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.POWER
)
assert current_power_in.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
current_power_in.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
@ -90,7 +87,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
current_power_in_low.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.POWER
)
assert current_power_in_low.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
current_power_in_low.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
@ -106,7 +102,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
current_power_out.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.POWER
)
assert current_power_out.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
current_power_out.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
@ -122,7 +117,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
current_power_out_low.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.POWER
)
assert current_power_out_low.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
current_power_out_low.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.MEASUREMENT
@ -140,10 +134,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
energy_consumption_peak_today.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.ENERGY
)
assert (
energy_consumption_peak_today.attributes.get(ATTR_ICON)
== "mdi:lightning-bolt"
)
assert (
energy_consumption_peak_today.attributes.get(ATTR_STATE_CLASS)
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)
== SensorDeviceClass.ENERGY
)
assert (
energy_consumption_off_peak_today.attributes.get(ATTR_ICON)
== "mdi:lightning-bolt"
)
assert (
energy_consumption_off_peak_today.attributes.get(ATTR_STATE_CLASS)
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)
== SensorDeviceClass.ENERGY
)
assert (
energy_production_peak_today.attributes.get(ATTR_ICON)
== "mdi:lightning-bolt"
)
assert (
energy_production_peak_today.attributes.get(ATTR_STATE_CLASS)
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)
== SensorDeviceClass.ENERGY
)
assert (
energy_production_off_peak_today.attributes.get(ATTR_ICON)
== "mdi:lightning-bolt"
)
assert (
energy_production_off_peak_today.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.TOTAL_INCREASING
@ -221,7 +199,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
assert (
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_UNIT_OF_MEASUREMENT)
@ -234,7 +211,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
energy_this_week.attributes.get(ATTR_DEVICE_CLASS)
== SensorDeviceClass.ENERGY
)
assert energy_this_week.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
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)
== SensorDeviceClass.ENERGY
)
assert energy_this_month.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
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)
== SensorDeviceClass.ENERGY
)
assert energy_this_year.attributes.get(ATTR_ICON) == "mdi:lightning-bolt"
assert (
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")
assert current_gas.state == "0.0"
assert current_gas.attributes.get(ATTR_DEVICE_CLASS) is None
assert current_gas.attributes.get(ATTR_ICON) == "mdi:fire"
assert (
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")
assert gas_today.state == "1.1"
assert gas_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
assert gas_today.attributes.get(ATTR_ICON) == "mdi:counter"
assert (
gas_today.attributes.get(ATTR_STATE_CLASS)
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")
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_ICON) == "mdi:counter"
assert (
gas_this_week.attributes.get(ATTR_STATE_CLASS)
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")
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_ICON) == "mdi:counter"
assert (
gas_this_month.attributes.get(ATTR_STATE_CLASS)
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")
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_ICON) == "mdi:counter"
assert (
gas_this_year.attributes.get(ATTR_STATE_CLASS)
is SensorStateClass.TOTAL_INCREASING