Add icon
parent
847e92f57a
commit
bd8881cbe1
|
@ -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. """
|
||||
|
|
Loading…
Reference in New Issue