Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bizkaibus, Biscays (Spain) bus service component #22934

Merged
merged 19 commits into from May 5, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Changed optional parameter to required

  • Loading branch information...
UgaitzEtxebarria committed Apr 21, 2019
commit 06940ce16deda12e8738a0e7524a90302a3166db
@@ -23,7 +23,7 @@

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_STOP_ID): cv.string,
vol.Optional(CONF_ROUTE): cv.string,
vol.Required(CONF_ROUTE): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})

@@ -32,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Bizkaibus public transport sensor."""
name = config.get(CONF_NAME)
This conversation was marked as resolved by ludeeus

This comment has been minimized.

Copy link
@ludeeus

ludeeus Apr 18, 2019

Contributor

For required options, you should use dict['key'] instead of dict.get('key')

stop = config[CONF_STOP_ID]
route = config.get(CONF_ROUTE)
route = config[CONF_ROUTE]

data = Bizkaibus(stop, route)
add_entities([BizkaibusSensor(data, stop, route, name)], True)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.