mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Remove async_setup from gpslogger (#93893)
This commit is contained in:
parent
c5dd540ffc
commit
4e5902c15b
@ -12,7 +12,6 @@ from homeassistant.core import HomeAssistant
|
|||||||
from homeassistant.helpers import config_entry_flow
|
from homeassistant.helpers import config_entry_flow
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.typing import ConfigType
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_ACCURACY,
|
ATTR_ACCURACY,
|
||||||
@ -55,12 +54,6 @@ WEBHOOK_SCHEMA = vol.Schema(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, hass_config: ConfigType) -> bool:
|
|
||||||
"""Set up the GPSLogger component."""
|
|
||||||
hass.data[DOMAIN] = {"devices": set(), "unsub_device_tracker": {}}
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
async def handle_webhook(hass, webhook_id, request):
|
async def handle_webhook(hass, webhook_id, request):
|
||||||
"""Handle incoming webhook with GPSLogger request."""
|
"""Handle incoming webhook with GPSLogger request."""
|
||||||
try:
|
try:
|
||||||
@ -95,6 +88,7 @@ async def handle_webhook(hass, webhook_id, request):
|
|||||||
|
|
||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Configure based on config entry."""
|
"""Configure based on config entry."""
|
||||||
|
hass.data.setdefault(DOMAIN, {"devices": set(), "unsub_device_tracker": {}})
|
||||||
webhook.async_register(
|
webhook.async_register(
|
||||||
hass, DOMAIN, "GPSLogger", entry.data[CONF_WEBHOOK_ID], handle_webhook
|
hass, DOMAIN, "GPSLogger", entry.data[CONF_WEBHOOK_ID], handle_webhook
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user