Skip to content

Commit

Permalink
Run formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 23, 2023
1 parent 31cde20 commit 8cfc90e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions custom_components/powercalc/sensors/power.py
Expand Up @@ -393,7 +393,8 @@ def __init__(
self._init_calculation_strategy(factory=calculation_strategy_factory)

def _init_calculation_strategy(
self, factory: PowerCalculatorStrategyFactory,
self,
factory: PowerCalculatorStrategyFactory,
) -> None:
self._strategy_instance = factory.create(
self._sensor_config,
Expand All @@ -413,14 +414,16 @@ async def appliance_state_listener(event: Event) -> None:
"""Handle for state changes for dependent sensors."""
new_state = event.data.get("new_state")
await self._handle_source_entity_state_change(
self._source_entity.entity_id, new_state,
self._source_entity.entity_id,
new_state,
)
async_dispatcher_send(self.hass, SIGNAL_POWER_SENSOR_STATE_CHANGE)

async def template_change_listener(*_: Any) -> None: # noqa: ANN401
state = self.hass.states.get(self._source_entity.entity_id)
await self._handle_source_entity_state_change(
self._source_entity.entity_id, state,
self._source_entity.entity_id,
state,
)
async_dispatcher_send(self.hass, SIGNAL_POWER_SENSOR_STATE_CHANGE)

Expand Down
3 changes: 2 additions & 1 deletion custom_components/powercalc/strategy/playbook.py
Expand Up @@ -49,7 +49,8 @@ def __init__(
self._power = Decimal(0)
if not playbook_directory:
self._playbook_directory: str = os.path.join(
hass.config.config_dir, "powercalc/playbooks",
hass.config.config_dir,
"powercalc/playbooks",
)

def set_update_callback(self, update_callback: Callable[[Decimal], None]) -> None:
Expand Down

0 comments on commit 8cfc90e

Please sign in to comment.