Initil after Upgrade
This commit is contained in:
@@ -44,7 +44,8 @@ class MultiSwitchStrategy(PowerCalculationStrategyInterface):
|
||||
async def calculate(self, entity_state: State) -> Decimal | None:
|
||||
if self.known_states is None:
|
||||
self.known_states = {
|
||||
entity_id: (state.state if (state := self.hass.states.get(entity_id)) else STATE_UNAVAILABLE) for entity_id in self.switch_entities
|
||||
entity_id: (state.state if (state := self.hass.states.get(entity_id)) else STATE_UNAVAILABLE)
|
||||
for entity_id in self.switch_entities
|
||||
}
|
||||
|
||||
if entity_state.entity_id != DUMMY_ENTITY_ID and entity_state.entity_id in self.switch_entities:
|
||||
@@ -60,7 +61,7 @@ class MultiSwitchStrategy(PowerCalculationStrategyInterface):
|
||||
return Decimal(sum(_get_power(state) for state in self.known_states.values()))
|
||||
|
||||
def get_entities_to_track(self) -> list[str | TrackTemplate]:
|
||||
return self.switch_entities # type: ignore
|
||||
return [*self.switch_entities]
|
||||
|
||||
def can_calculate_standby(self) -> bool:
|
||||
return self.off_power is not None
|
||||
|
||||
Reference in New Issue
Block a user