mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Add current temperature as separate sensor in Toon (#37336)
* Add current temperature as seperate sensor in Toon * Set default enabled to False * Trigger build
This commit is contained in:
parent
c89c0d7824
commit
07d7191db3
@ -5,7 +5,7 @@ from homeassistant.components.binary_sensor import (
|
|||||||
DEVICE_CLASS_CONNECTIVITY,
|
DEVICE_CLASS_CONNECTIVITY,
|
||||||
DEVICE_CLASS_PROBLEM,
|
DEVICE_CLASS_PROBLEM,
|
||||||
)
|
)
|
||||||
from homeassistant.components.sensor import DEVICE_CLASS_POWER
|
from homeassistant.components.sensor import DEVICE_CLASS_POWER, DEVICE_CLASS_TEMPERATURE
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_DEVICE_CLASS,
|
ATTR_DEVICE_CLASS,
|
||||||
ATTR_ICON,
|
ATTR_ICON,
|
||||||
@ -13,6 +13,7 @@ from homeassistant.const import (
|
|||||||
ATTR_UNIT_OF_MEASUREMENT,
|
ATTR_UNIT_OF_MEASUREMENT,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
ENERGY_KILO_WATT_HOUR,
|
||||||
POWER_WATT,
|
POWER_WATT,
|
||||||
|
TEMP_CELSIUS,
|
||||||
UNIT_PERCENTAGE,
|
UNIT_PERCENTAGE,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -112,6 +113,15 @@ BINARY_SENSOR_ENTITIES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SENSOR_ENTITIES = {
|
SENSOR_ENTITIES = {
|
||||||
|
"current_display_temperature": {
|
||||||
|
ATTR_NAME: "Temperature",
|
||||||
|
ATTR_SECTION: "thermostat",
|
||||||
|
ATTR_MEASUREMENT: "current_display_temperature",
|
||||||
|
ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS,
|
||||||
|
ATTR_DEVICE_CLASS: DEVICE_CLASS_TEMPERATURE,
|
||||||
|
ATTR_ICON: None,
|
||||||
|
ATTR_DEFAULT_ENABLED: False,
|
||||||
|
},
|
||||||
"gas_average": {
|
"gas_average": {
|
||||||
ATTR_NAME: "Average Gas Usage",
|
ATTR_NAME: "Average Gas Usage",
|
||||||
ATTR_SECTION: "gas_usage",
|
ATTR_SECTION: "gas_usage",
|
||||||
|
@ -19,6 +19,7 @@ from .const import (
|
|||||||
from .coordinator import ToonDataUpdateCoordinator
|
from .coordinator import ToonDataUpdateCoordinator
|
||||||
from .models import (
|
from .models import (
|
||||||
ToonBoilerDeviceEntity,
|
ToonBoilerDeviceEntity,
|
||||||
|
ToonDisplayDeviceEntity,
|
||||||
ToonElectricityMeterDeviceEntity,
|
ToonElectricityMeterDeviceEntity,
|
||||||
ToonEntity,
|
ToonEntity,
|
||||||
ToonGasMeterDeviceEntity,
|
ToonGasMeterDeviceEntity,
|
||||||
@ -49,6 +50,10 @@ async def async_setup_entry(
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
sensors.extend(
|
||||||
|
[ToonDisplayDeviceSensor(coordinator, key="current_display_temperature")]
|
||||||
|
)
|
||||||
|
|
||||||
if coordinator.data.gas_usage and coordinator.data.gas_usage.is_smart:
|
if coordinator.data.gas_usage and coordinator.data.gas_usage.is_smart:
|
||||||
sensors.extend(
|
sensors.extend(
|
||||||
[
|
[
|
||||||
@ -147,3 +152,7 @@ class ToonSolarDeviceSensor(ToonSensor, ToonSolarDeviceEntity):
|
|||||||
|
|
||||||
class ToonBoilerDeviceSensor(ToonSensor, ToonBoilerDeviceEntity):
|
class ToonBoilerDeviceSensor(ToonSensor, ToonBoilerDeviceEntity):
|
||||||
"""Defines a Boiler sensor."""
|
"""Defines a Boiler sensor."""
|
||||||
|
|
||||||
|
|
||||||
|
class ToonDisplayDeviceSensor(ToonSensor, ToonDisplayDeviceEntity):
|
||||||
|
"""Defines a Display sensor."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user