8000 Stop GTFS component from overwriting friendly_name by phardy · Pull Request #3798 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Stop GTFS component from overwriting friendly_name #3798

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

Merged
merged 3 commits into from
Oct 11, 2016

Conversation

phardy
Copy link
Contributor
@phardy phardy commented Oct 10, 2016

Description: The GTFSDepartureSensor.update() method always updates self._name, overwriting any custom name that may have been passed to the platform in configuration.yaml. This is a quick change to correct that behaviour.

Related issue (if applicable): N/A

Pull request in home-assistant.io with documentation (if applicable): N/A

Example entry for configuration.yaml (if applicable): N/A

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

There's currently no tests for the GTFS component. I'd be happy to assist writing some, but I'm not yet sure how to go about mocking a whole GTFS schema.

@@ -233,7 +234,8 @@ def update(self):
trip = self._departure['trip']

name = '{} {} to {} next departure'
self._name = name.format(agency.agency_name,
self._name = self._custom_name or \
name.format(agency.agency_name,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

farcy v1.1

  • 26: E127 continuation line over-indented for visual indent

@phardy phardy changed the title Prevent update from clobbering configured name. Stop GTFS component from overwriting friendly_name Oct 10, 2016
@balloob
Copy link
Member
balloob commented Oct 11, 2016

🐬

@balloob balloob merged commit c8ca66b into home-assistant:dev Oct 11, 2016
@phardy phardy deleted the gtfs-name-fix branch October 11, 2016 12:21
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0