Initil after Upgrade

This commit is contained in:
2026-06-15 10:53:52 -04:00
parent 2fe9bf0dd6
commit 887feaa50a
143 changed files with 2288 additions and 881 deletions
+9 -3
View File
@@ -48,7 +48,11 @@ class WledStrategy(PowerCalculationStrategyInterface):
self._estimated_current_entity: str | None = None
async def calculate(self, entity_state: State) -> Decimal | None:
light_state = entity_state if entity_state.entity_id == self._light_entity.entity_id else self._hass.states.get(self._light_entity.entity_id)
light_state = (
entity_state
if entity_state.entity_id == self._light_entity.entity_id
else self._hass.states.get(self._light_entity.entity_id)
)
if light_state.state in OFF_STATES and self._standby_power:
return self._standby_power
@@ -72,7 +76,7 @@ class WledStrategy(PowerCalculationStrategyInterface):
self._power_factor,
)
power = float(entity_state.state) / 1000 * self._voltage * self._power_factor
return await evaluate_power(power)
return evaluate_power(power)
async def find_estimated_current_entity(self) -> str:
entity_reg = entity_registry.async_get(self._hass)
@@ -86,7 +90,9 @@ class WledStrategy(PowerCalculationStrategyInterface):
if entity:
return entity
raise StrategyConfigurationError("No estimated current entity found. Probably brightness limiter not enabled. See documentation")
raise StrategyConfigurationError(
"No estimated current entity found. Probably brightness limiter not enabled. See documentation",
)
def get_entities_to_track(self) -> list[str | TrackTemplate]:
if self._estimated_current_entity: