mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fixes based on balloob's comments
This commit is contained in:
parent
1eb3610a11
commit
b74e70d4e0
@ -9,13 +9,14 @@ device_tracker:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
URL_API_GEOFANCY_ENDPOINT,
|
|
||||||
HTTP_UNPROCESSABLE_ENTITY, HTTP_INTERNAL_SERVER_ERROR)
|
HTTP_UNPROCESSABLE_ENTITY, HTTP_INTERNAL_SERVER_ERROR)
|
||||||
|
|
||||||
DEPENDENCIES = ['http']
|
DEPENDENCIES = ['http']
|
||||||
|
|
||||||
_SEE = 0
|
_SEE = 0
|
||||||
|
|
||||||
|
URL_API_GEOFANCY_ENDPOINT = "/api/geofancy"
|
||||||
|
|
||||||
|
|
||||||
def setup_scanner(hass, config, see):
|
def setup_scanner(hass, config, see):
|
||||||
""" Set up an endpoint for the Geofancy app. """
|
""" Set up an endpoint for the Geofancy app. """
|
||||||
@ -66,12 +67,6 @@ def _handle_get_api_geofancy(handler, path_match, data):
|
|||||||
device_uuid = data['device']
|
device_uuid = data['device']
|
||||||
device_entity_id = device_uuid.replace('-', '')
|
device_entity_id = device_uuid.replace('-', '')
|
||||||
|
|
||||||
kwargs = {
|
_SEE(dev_id=device_entity_id, gps=gps_coords, location_name=data['id'])
|
||||||
'dev_id': device_entity_id,
|
|
||||||
'gps': gps_coords,
|
|
||||||
'location_name': data['id']
|
|
||||||
}
|
|
||||||
|
|
||||||
_SEE(**kwargs)
|
|
||||||
|
|
||||||
handler.write_json_message("Geofancy message processed")
|
handler.write_json_message("Geofancy message processed")
|
||||||
|
@ -145,7 +145,6 @@ URL_API_SERVICES_SERVICE = "/api/services/{}/{}"
|
|||||||
URL_API_EVENT_FORWARD = "/api/event_forwarding"
|
URL_API_EVENT_FORWARD = "/api/event_forwarding"
|
||||||
URL_API_COMPONENTS = "/api/components"
|
URL_API_COMPONENTS = "/api/components"
|
||||||
URL_API_BOOTSTRAP = "/api/bootstrap"
|
URL_API_BOOTSTRAP = "/api/bootstrap"
|
||||||
URL_API_GEOFANCY_ENDPOINT = '/api/geofancy'
|
|
||||||
|
|
||||||
HTTP_OK = 200
|
HTTP_OK = 200
|
||||||
HTTP_CREATED = 201
|
HTTP_CREATED = 201
|
||||||
|
Loading…
x
Reference in New Issue
Block a user