pull/1108/head
Fabian Affolter 2016-02-03 00:12:01 +01:00
parent 847e92f57a
commit bd8881cbe1
1 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,7 @@ ATTR_DEPARTURE_TIME2 = 'Next on departure'
ATTR_START = 'Start'
ATTR_TARGET = 'Destination'
ATTR_REMAINING_TIME = 'Remaining time'
ICON = 'mdi:bus'
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
@ -86,6 +87,11 @@ class SwissPublicTransportSensor(Entity):
':'.join(str(self._times[2]).split(':')[:2]))
}
@property
def icon(self):
""" Icon to use in the frontend, if any. """
return ICON
# pylint: disable=too-many-branches
def update(self):
""" Gets the latest data from opendata.ch and updates the states. """