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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions homeassistant/components/sensor/gtfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def __init__(self, pygtfs, name, origin, destination):
self._pygtfs = pygtfs
self.origin = origin
self.destination = destination
self._name = name
self._custom_name = name
self._name = ''
sel 7488 f._unit_of_measurement = 'min'
self._state = 0
self._attributes = {}
Expand Down Expand Up @@ -233,9 +234,10 @@ def update(self):
trip = self._departure['trip']

name = '{} {} to {} next departure'
self._name = name.format(agency.agency_name,
origin_station.stop_id,
destination_station.stop_id)
self._name = (self._custom_name or
name.format(agency.agency_name,
origin_station.stop_id,
destination_station.stop_id))

# Build attributes
self._attributes = {}
Expand Down
0