From 63d9ea66431a903993640ff2e9a3687d55aa464d Mon Sep 17 00:00:00 2001 From: Erik Eriksson Date: Sun, 9 Oct 2016 18:15:58 +0200 Subject: [PATCH] slugify (#3777) --- homeassistant/components/device_tracker/volvooncall.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/device_tracker/volvooncall.py b/homeassistant/components/device_tracker/volvooncall.py index 8f5cf5fff7a..746bbea6ccf 100644 --- a/homeassistant/components/device_tracker/volvooncall.py +++ b/homeassistant/components/device_tracker/volvooncall.py @@ -14,6 +14,7 @@ import requests import homeassistant.helpers.config_validation as cv from homeassistant.helpers.event import track_point_in_utc_time from homeassistant.util.dt import utcnow +from homeassistant.util import slugify from homeassistant.const import ( CONF_PASSWORD, CONF_SCAN_INTERVAL, @@ -87,7 +88,7 @@ def setup_scanner(hass, config, see): vehicle_url = rel["vehicle"] + '/' attributes = query("attributes", vehicle_url) - dev_id = "volvo_" + attributes["registrationNumber"] + dev_id = "volvo_" + slugify(attributes["registrationNumber"]) host_name = "%s %s/%s" % (attributes["registrationNumber"], attributes["vehicleType"], attributes["modelYear"])