Skip to content

Commit

Permalink
Support configuration of region (no service url neccessary (#10513)
Browse files Browse the repository at this point in the history
  • Loading branch information
molobrakos authored and balloob committed Nov 11, 2017
1 parent b284cc5 commit 75836af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions homeassistant/components/volvooncall.py
Expand Up @@ -22,13 +22,14 @@

DATA_KEY = DOMAIN

REQUIREMENTS = ['volvooncall==0.3.3']
REQUIREMENTS = ['volvooncall==0.4.0']

_LOGGER = logging.getLogger(__name__)

CONF_UPDATE_INTERVAL = 'update_interval'
MIN_UPDATE_INTERVAL = timedelta(minutes=1)
DEFAULT_UPDATE_INTERVAL = timedelta(minutes=1)
CONF_REGION = 'region'
CONF_SERVICE_URL = 'service_url'

SIGNAL_VEHICLE_SEEN = '{}.vehicle_seen'.format(DOMAIN)
Expand Down Expand Up @@ -58,18 +59,20 @@
{cv.slug: cv.string}),
vol.Optional(CONF_RESOURCES): vol.All(
cv.ensure_list, [vol.In(RESOURCES)]),
vol.Optional(CONF_REGION): cv.string,
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 Connection, DEFAULT_SERVICE_URL
from volvooncall import Connection
connection = Connection(
config[DOMAIN].get(CONF_USERNAME),
config[DOMAIN].get(CONF_PASSWORD),
config[DOMAIN].get(CONF_SERVICE_URL, DEFAULT_SERVICE_URL))
config[DOMAIN].get(CONF_SERVICE_URL),
config[DOMAIN].get(CONF_REGION))

interval = config[DOMAIN].get(CONF_UPDATE_INTERVAL)

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -1094,7 +1094,7 @@ upsmychoice==1.0.6
uvcclient==0.10.1

# homeassistant.components.volvooncall
volvooncall==0.3.3
volvooncall==0.4.0

# homeassistant.components.verisure
vsure==1.3.7
Expand Down

0 comments on commit 75836af

Please sign in to comment.