Update Switcher temperature sensor device class and state class (#143722)

* Update Switcher temperature sensor device class and state class

* Remove  temperature translation key

* Remove icon
This commit is contained in:
Shay Levy 2025-04-26 17:22:44 +03:00 committed by GitHub
parent 03bacd747e
commit d8cb7c475b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 9 deletions

View File

@ -20,9 +20,6 @@
},
"auto_shutdown": {
"default": "mdi:progress-clock"
},
"temperature": {
"default": "mdi:thermometer"
}
}
},

View File

@ -21,7 +21,7 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfElectricCurrent, UnitOfPower
from homeassistant.const import UnitOfElectricCurrent, UnitOfPower, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@ -71,7 +71,9 @@ TIME_SENSORS: list[SwitcherSensorEntityDescription] = [
TEMPERATURE_SENSORS: list[SwitcherSensorEntityDescription] = [
SwitcherSensorEntityDescription(
key="temperature",
translation_key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda data: cast(SwitcherThermostatBase, data).temperature,
),
]

View File

@ -67,9 +67,6 @@
},
"auto_shutdown": {
"name": "Auto shutdown"
},
"temperature": {
"name": "Current temperature"
}
},
"switch": {

View File

@ -32,7 +32,7 @@ DEVICE_SENSORS_TUPLE = (
(
DUMMY_THERMOSTAT_DEVICE,
[
("current_temperature", "temperature"),
("temperature", "temperature"),
],
),
)