Add destination and icon (#18210)

* Add destination and icon

* Update test_transport_nsw.py

* Error handling fix in external lib

* Reverse sensor name change to prevent break
This commit is contained in:
Dav0815 authored and Fabian Affolter committed 2018-11-05 08:27:20 +01:00
1 parent 1c3ef8be55
commit 6e4ce35a69
4 files changed
+43 -11

No files matched your search

@@ -10,18 +10,21 @@ VALID_CONFIG = {'sensor': {
'platform': 'transport_nsw',
'stop_id': '209516',
'route': '199',
'destination': '',
'api_key': 'YOUR_API_KEY'}
}
def get_departuresMock(_stop_id, route, api_key):
def get_departuresMock(_stop_id, route, destination, api_key):
"""Mock TransportNSW departures loading."""
data = {
'stop_id': '209516',
'route': '199',
'due': 16,
'delay': 6,
'real_time': 'y'
'real_time': 'y',
'destination': 'Palm Beach',
'mode': 'Bus'
}
return data
@@ -48,3 +51,5 @@ class TestRMVtransportSensor(unittest.TestCase):
assert state.attributes['route'] == '199'
assert state.attributes['delay'] == 6
assert state.attributes['real_time'] == 'y'
assert state.attributes['destination'] == 'Palm Beach'
assert state.attributes['mode'] == 'Bus'