mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Lint
This commit is contained in:
parent
b75356d532
commit
9036aafc81
@ -5,9 +5,9 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/locative/
|
https://home-assistant.io/components/locative/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.components.device_tracker import \
|
from homeassistant.components.device_tracker import \
|
||||||
@ -67,8 +67,8 @@ async def handle_webhook(hass, webhook_id, request):
|
|||||||
"""Handle incoming webhook from Locative."""
|
"""Handle incoming webhook from Locative."""
|
||||||
try:
|
try:
|
||||||
data = WEBHOOK_SCHEMA(dict(await request.post()))
|
data = WEBHOOK_SCHEMA(dict(await request.post()))
|
||||||
except vol.MultipleInvalid as e:
|
except vol.MultipleInvalid as error:
|
||||||
return e.error_message, HTTP_UNPROCESSABLE_ENTITY
|
return error.error_message, HTTP_UNPROCESSABLE_ENTITY
|
||||||
|
|
||||||
device = data[ATTR_DEVICE_ID]
|
device = data[ATTR_DEVICE_ID]
|
||||||
location_name = data.get(ATTR_ID, data[ATTR_TRIGGER]).lower()
|
location_name = data.get(ATTR_ID, data[ATTR_TRIGGER]).lower()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user