Skip to content

Commit

Permalink
Add PID sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Dec 5, 2024
1 parent 7a2b593 commit 70071fc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion custom_components/thermia/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .coordinator import ThermiaDataUpdateCoordinator
from .sensors.active_alarms_sensor import ThermiaActiveAlarmsSensor
from .sensors.generic_sensor import ThermiaGenericSensor

Expand All @@ -25,7 +26,7 @@ async def async_setup_entry(
) -> None:
"""Set up the Thermia sensors."""

coordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator: ThermiaDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]

hass_thermia_sensors = []

Expand Down Expand Up @@ -271,6 +272,22 @@ async def async_setup_entry(
)
)

if heat_pump.operational_status_pid is not None:
hass_thermia_sensors.append(
ThermiaGenericSensor(
coordinator,
idx,
"is_online",
"PID",
"mdi:math-integral-box",
EntityCategory.DIAGNOSTIC,
None,
"measurement",
"operational_status_pid",
None,
)
)

###########################################################################
# Operational time data
###########################################################################
Expand Down

0 comments on commit 70071fc

Please sign in to comment.