Skip to content

Commit

Permalink
Add service_url config option to volvooncall (#7919)
Browse files Browse the repository at this point in the history
* Add service_url config option to volvooncall

* Import default value from volvooncall lib
  • Loading branch information
mpstephana authored and pvizeli committed Jun 7, 2017
1 parent 5c96936 commit 5504a51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion homeassistant/components/volvooncall.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
CONF_UPDATE_INTERVAL = 'update_interval'
MIN_UPDATE_INTERVAL = timedelta(minutes=1)
DEFAULT_UPDATE_INTERVAL = timedelta(minutes=1)
CONF_SERVICE_URL = 'service_url'

RESOURCES = {'position': ('device_tracker',),
'lock': ('lock', 'Lock'),
Expand All @@ -51,16 +52,19 @@
{cv.slug: cv.string}),
vol.Optional(CONF_RESOURCES): vol.All(
cv.ensure_list, [vol.In(RESOURCES)]),
vol.Optional(CONF_SERVICE_URL): cv.string,
}),
}, extra=vol.ALLOW_EXTRA)


def setup(hass, config):
"""Set up the Volvo On Call component."""
from volvooncall import DEFAULT_SERVICE_URL
from volvooncall import Connection
connection = Connection(
config[DOMAIN].get(CONF_USERNAME),
config[DOMAIN].get(CONF_PASSWORD))
config[DOMAIN].get(CONF_PASSWORD),
config[DOMAIN].get(CONF_SERVICE_URL, DEFAULT_SERVICE_URL))

interval = config[DOMAIN].get(CONF_UPDATE_INTERVAL)

Expand Down

0 comments on commit 5504a51

Please sign in to comment.