mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Add icon
This commit is contained in:
parent
847e92f57a
commit
bd8881cbe1
@ -23,6 +23,7 @@ ATTR_DEPARTURE_TIME2 = 'Next on departure'
|
|||||||
ATTR_START = 'Start'
|
ATTR_START = 'Start'
|
||||||
ATTR_TARGET = 'Destination'
|
ATTR_TARGET = 'Destination'
|
||||||
ATTR_REMAINING_TIME = 'Remaining time'
|
ATTR_REMAINING_TIME = 'Remaining time'
|
||||||
|
ICON = 'mdi:bus'
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
||||||
@ -86,6 +87,11 @@ class SwissPublicTransportSensor(Entity):
|
|||||||
':'.join(str(self._times[2]).split(':')[:2]))
|
':'.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
|
# pylint: disable=too-many-branches
|
||||||
def update(self):
|
def update(self):
|
||||||
""" Gets the latest data from opendata.ch and updates the states. """
|
""" Gets the latest data from opendata.ch and updates the states. """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user