Use device name for device_tracker entry (#24155)

pull/24412/head
Robbie Trencheny 2019-05-28 19:52:47 -07:00 committed by Paulus Schoutsen
parent 1b543cf538
commit d9c78b77cb
1 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,8 @@ from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.template import attach
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import slugify
from .const import (ATTR_ALTITUDE, ATTR_BATTERY, ATTR_COURSE, ATTR_DEVICE_ID,
ATTR_DEVICE_NAME, ATTR_EVENT_DATA, ATTR_EVENT_TYPE,
ATTR_GPS, ATTR_GPS_ACCURACY, ATTR_LOCATION_NAME,
@ -150,7 +152,7 @@ async def handle_webhook(hass: HomeAssistantType, webhook_id: str,
if webhook_type == WEBHOOK_TYPE_UPDATE_LOCATION:
see_payload = {
ATTR_DEV_ID: registration[ATTR_DEVICE_ID],
ATTR_DEV_ID: slugify(registration[ATTR_DEVICE_NAME]),
ATTR_GPS: data[ATTR_GPS],
ATTR_GPS_ACCURACY: data[ATTR_GPS_ACCURACY],
}