Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Sep 14, 2024
1 parent d57a108 commit 3e0fd63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions custom_components/powercalc/sensors/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,12 @@ async def _handle_source_entity_state_change(
if self._power is not None:
self._power = round(self._power, self._rounding_digits)

if state:
_LOGGER.debug(
'%s: State changed to "%s". Power:%s',
state.entity_id,
state.state,
self._power,
)
_LOGGER.debug(
'%s: State changed to "%s". Power:%s',
state.entity_id,
state.state,
self._power,
)

self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async def test_repair_issue_with_none_sensors(hass: HomeAssistant) -> None:
power_entry = await create_mocked_virtual_power_sensor_entry(hass, "Power")

none_entries = []
for i in range(10): # noqa
for _ in range(10):
none_entries.append(
await setup_config_entry(
hass,
Expand Down

0 comments on commit 3e0fd63

Please sign in to comment.