Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
c-st committed Jun 12, 2024
1 parent 9650ee9 commit cfe428d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion custom_components/auto_areas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

from .const import DOMAIN, LOGGER, ISSUE_TYPE_YAML_DETECTED

PLATFORMS: list[Platform] = [Platform.SWITCH, Platform.BINARY_SENSOR, Platform.SENSOR]
PLATFORMS: list[Platform] = [Platform.SWITCH,
Platform.BINARY_SENSOR, Platform.SENSOR]


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Expand All @@ -36,19 +37,23 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

return True


async def async_init(hass: HomeAssistant, entry: ConfigEntry, auto_area: AutoArea):
"""Initialize component."""
await auto_area.initialize()
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
hass.async_create_task(
hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
)


def initialize(hass: HomeAssistant, entry: ConfigEntry, auto_area: AutoArea):
"""Initialize area after HA has started."""
return asyncio.run_coroutine_threadsafe(
async_init(hass, entry, auto_area), hass.loop
).result()


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Handle removal of an entry."""
# unsubscribe from changes:
Expand Down
1 change: 0 additions & 1 deletion custom_components/auto_areas/auto_lights.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Auto lights."""
from homeassistant.core import State
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.const import (
Expand Down
1 change: 0 additions & 1 deletion custom_components/auto_areas/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.core import State
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.entity import DeviceInfo
Expand Down
1 change: 0 additions & 1 deletion custom_components/auto_areas/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
SensorDeviceClass,
SensorEntity,
)
from homeassistant.core import State
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.entity import DeviceInfo
Expand Down

0 comments on commit cfe428d

Please sign in to comment.