updated apps

This commit is contained in:
2026-07-14 23:57:03 -04:00
parent 6cc7212cef
commit 010e828e9c
797 changed files with 45153 additions and 4246 deletions
@@ -25,6 +25,7 @@ from custom_components.powercalc.const import (
SIGNAL_POWER_SENSOR_STATE_CHANGE,
)
from custom_components.powercalc.sensors.energy import create_energy_sensor
from custom_components.powercalc.sensors.energy_related import create_energy_related_sensors
from custom_components.powercalc.sensors.power import PowerSensor
_LOGGER = logging.getLogger(__name__)
@@ -52,10 +53,11 @@ def create_general_standby_sensors(
source_entity,
)
sensors.append(energy_sensor)
sensors.extend(create_energy_related_sensors(hass, sensor_config, energy_sensor, source_entity))
return sensors
class StandbyPowerSensor(SensorEntity, PowerSensor):
class StandbyPowerSensor(PowerSensor, SensorEntity):
_attr_device_class = SensorDeviceClass.POWER
_attr_state_class = SensorStateClass.MEASUREMENT
_attr_native_unit_of_measurement = UnitOfPower.WATT
@@ -70,10 +72,12 @@ class StandbyPowerSensor(SensorEntity, PowerSensor):
async def async_added_to_hass(self) -> None:
"""Register state listeners."""
await super().async_added_to_hass()
async_dispatcher_connect(
self.hass,
SIGNAL_POWER_SENSOR_STATE_CHANGE,
self._recalculate,
self.async_on_remove(
async_dispatcher_connect(
self.hass,
SIGNAL_POWER_SENSOR_STATE_CHANGE,
self._recalculate,
),
)
async def _recalculate(self) -> None: