mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Make sure Locative doesn't submit invalid device IDs (#20784)
This commit is contained in:
parent
208f1a4a47
commit
65a225da75
@ -11,6 +11,7 @@ from homeassistant.components.device_tracker import \
|
|||||||
from homeassistant.components.locative import DOMAIN as LOCATIVE_DOMAIN
|
from homeassistant.components.locative import DOMAIN as LOCATIVE_DOMAIN
|
||||||
from homeassistant.components.locative import TRACKER_UPDATE
|
from homeassistant.components.locative import TRACKER_UPDATE
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ async def async_setup_entry(hass, entry, async_see):
|
|||||||
async def _set_location(device, gps_location, location_name):
|
async def _set_location(device, gps_location, location_name):
|
||||||
"""Fire HA event to set location."""
|
"""Fire HA event to set location."""
|
||||||
await async_see(
|
await async_see(
|
||||||
dev_id=device,
|
dev_id=slugify(device),
|
||||||
gps=gps_location,
|
gps=gps_location,
|
||||||
location_name=location_name
|
location_name=location_name
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user