slugify (#3777)
This commit is contained in:
parent
574df0f420
commit
016e8f833d
1 changed files with 2 additions and 1 deletions
|
@ -14,6 +14,7 @@ import requests
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.event import track_point_in_utc_time
|
from homeassistant.helpers.event import track_point_in_utc_time
|
||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
|
from homeassistant.util import slugify
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_PASSWORD,
|
CONF_PASSWORD,
|
||||||
CONF_SCAN_INTERVAL,
|
CONF_SCAN_INTERVAL,
|
||||||
|
@ -87,7 +88,7 @@ def setup_scanner(hass, config, see):
|
||||||
vehicle_url = rel["vehicle"] + '/'
|
vehicle_url = rel["vehicle"] + '/'
|
||||||
attributes = query("attributes", vehicle_url)
|
attributes = query("attributes", vehicle_url)
|
||||||
|
|
||||||
dev_id = "volvo_" + attributes["registrationNumber"]
|
dev_id = "volvo_" + slugify(attributes["registrationNumber"])
|
||||||
host_name = "%s %s/%s" % (attributes["registrationNumber"],
|
host_name = "%s %s/%s" % (attributes["registrationNumber"],
|
||||||
attributes["vehicleType"],
|
attributes["vehicleType"],
|
||||||
attributes["modelYear"])
|
attributes["modelYear"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue