Fix london_underground issue (#19642)
* Update london_underground.py * Update test * Update london_underground.py * Update london_underground.py * Update london_underground.py * Fix lint * Use london-tube-status==0.2
This commit is contained in:
parent
4b541f4058
commit
ff80fc347b
5 changed files with 7 additions and 545 deletions
|
@ -777,6 +777,7 @@ omit =
|
|||
homeassistant/components/sensor/launch_library.py
|
||||
homeassistant/components/sensor/linky.py
|
||||
homeassistant/components/sensor/linux_battery.py
|
||||
homeassistant/components/sensor/london_underground.py
|
||||
homeassistant/components/sensor/loopenergy.py
|
||||
homeassistant/components/sensor/luftdaten.py
|
||||
homeassistant/components/sensor/lyft.py
|
||||
|
|
|
@ -8,12 +8,12 @@ import logging
|
|||
from datetime import timedelta
|
||||
|
||||
import voluptuous as vol
|
||||
import requests
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
REQUIREMENTS = ['london-tube-status==0.2']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -35,7 +35,6 @@ TUBE_LINES = [
|
|||
'TfL Rail',
|
||||
'Victoria',
|
||||
'Waterloo & City']
|
||||
URL = 'https://api.tfl.gov.uk/line/mode/tube,overground,dlr,tflrail/status'
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_LINE):
|
||||
|
@ -45,6 +44,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the Tube sensor."""
|
||||
from london_tube_status import TubeData
|
||||
data = TubeData()
|
||||
data.update()
|
||||
sensors = []
|
||||
|
@ -93,43 +93,3 @@ class LondonTubeSensor(Entity):
|
|||
self._data.update()
|
||||
self._state = self._data.data[self.name]['State']
|
||||
self._description = self._data.data[self.name]['Description']
|
||||
|
||||
|
||||
class TubeData:
|
||||
"""Get the latest tube data from TFL."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initialize the TubeData object."""
|
||||
self.data = None
|
||||
|
||||
# Update only once in scan interval.
|
||||
@Throttle(SCAN_INTERVAL)
|
||||
def update(self):
|
||||
"""Get the latest data from TFL."""
|
||||
response = requests.get(URL)
|
||||
if response.status_code != 200:
|
||||
_LOGGER.warning("Invalid response from API")
|
||||
else:
|
||||
self.data = parse_api_response(response.json())
|
||||
|
||||
|
||||
def parse_api_response(response):
|
||||
"""Take in the TFL API json response."""
|
||||
lines = [line['name'] for line in response]
|
||||
data_dict = dict.fromkeys(lines)
|
||||
|
||||
for line in response:
|
||||
statuses = [status['statusSeverityDescription']
|
||||
for status in line['lineStatuses']]
|
||||
state = ' + '.join(sorted(set(statuses)))
|
||||
|
||||
if state == 'Good Service':
|
||||
reason = 'Nothing to report'
|
||||
else:
|
||||
reason = ' *** '.join(
|
||||
[status['reason'] for status in line['lineStatuses']])
|
||||
|
||||
attr = {'State': state, 'Description': reason}
|
||||
data_dict[line['name']] = attr
|
||||
|
||||
return data_dict
|
||||
|
|
|
@ -627,6 +627,9 @@ locationsharinglib==3.0.9
|
|||
# homeassistant.components.logi_circle
|
||||
logi_circle==0.1.7
|
||||
|
||||
# homeassistant.components.sensor.london_underground
|
||||
london-tube-status==0.2
|
||||
|
||||
# homeassistant.components.luftdaten
|
||||
luftdaten==0.3.4
|
||||
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
"""The tests for the tube_state platform."""
|
||||
import unittest
|
||||
import requests_mock
|
||||
|
||||
from homeassistant.components.sensor.london_underground import CONF_LINE, URL
|
||||
from homeassistant.setup import setup_component
|
||||
from tests.common import load_fixture, get_test_home_assistant
|
||||
|
||||
VALID_CONFIG = {
|
||||
'platform': 'london_underground',
|
||||
CONF_LINE: [
|
||||
'London Overground',
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
class TestLondonTubeSensor(unittest.TestCase):
|
||||
"""Test the tube_state platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Initialize values for this testcase class."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.config = VALID_CONFIG
|
||||
|
||||
def tearDown(self):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
@requests_mock.Mocker()
|
||||
def test_setup(self, mock_req):
|
||||
"""Test for operational tube_state sensor with proper attributes."""
|
||||
mock_req.get(URL, text=load_fixture('london_underground.json'))
|
||||
assert setup_component(self.hass, 'sensor', {'sensor': self.config})
|
||||
|
||||
state = self.hass.states.get('sensor.london_overground')
|
||||
assert state.state == 'Minor Delays'
|
||||
assert state.attributes.get('Description') == 'something'
|
465
tests/fixtures/london_underground.json
vendored
465
tests/fixtures/london_underground.json
vendored
|
@ -1,465 +0,0 @@
|
|||
[
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "bakerloo",
|
||||
"name": "Bakerloo",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.703Z",
|
||||
"modified": "2017-06-28T11:43:10.703Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Bakerloo&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "central",
|
||||
"name": "Central",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.623Z",
|
||||
"modified": "2017-06-28T11:43:10.623Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Central&serviceTypes=Regular"
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Night",
|
||||
"uri": "/Line/Route?ids=Central&serviceTypes=Night"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "circle",
|
||||
"name": "Circle",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.733Z",
|
||||
"modified": "2017-06-28T11:43:10.733Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Circle&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "district",
|
||||
"name": "District",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.623Z",
|
||||
"modified": "2017-06-28T11:43:10.623Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=District&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "dlr",
|
||||
"name": "DLR",
|
||||
"modeName": "dlr",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.703Z",
|
||||
"modified": "2017-06-28T11:43:10.703Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=DLR&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "hammersmith-city",
|
||||
"name": "Hammersmith & City",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.67Z",
|
||||
"modified": "2017-06-28T11:43:10.67Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Hammersmith & City&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "jubilee",
|
||||
"name": "Jubilee",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.623Z",
|
||||
"modified": "2017-06-28T11:43:10.623Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Jubilee&serviceTypes=Regular"
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Night",
|
||||
"uri": "/Line/Route?ids=Jubilee&serviceTypes=Night"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "london-overground",
|
||||
"name": "London Overground",
|
||||
"modeName": "overground",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.607Z",
|
||||
"modified": "2017-06-28T11:43:10.607Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"lineId": "london-overground",
|
||||
"statusSeverity": 9,
|
||||
"statusSeverityDescription": "Minor Delays",
|
||||
"reason": "something",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities",
|
||||
"fromDate": "2017-06-29T06:27:21Z",
|
||||
"toDate": "2017-06-30T01:29:00Z",
|
||||
"isNow": true
|
||||
}
|
||||
],
|
||||
"disruption": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities",
|
||||
"category": "RealTime",
|
||||
"categoryDescription": "RealTime",
|
||||
"description": "London Overground: Minor delays Richmond to Stratford and Willesden Junction to Clapham Junction while we fix a faulty train at Richmond, GOOD SERVICE all other routes. ",
|
||||
"affectedRoutes": [],
|
||||
"affectedStops": [],
|
||||
"closureText": "minorDelays"
|
||||
}
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=London Overground&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "metropolitan",
|
||||
"name": "Metropolitan",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.703Z",
|
||||
"modified": "2017-06-28T11:43:10.703Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Metropolitan&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "northern",
|
||||
"name": "Northern",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.67Z",
|
||||
"modified": "2017-06-28T11:43:10.67Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Northern&serviceTypes=Regular"
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Night",
|
||||
"uri": "/Line/Route?ids=Northern&serviceTypes=Night"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "piccadilly",
|
||||
"name": "Piccadilly",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.67Z",
|
||||
"modified": "2017-06-28T11:43:10.67Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Piccadilly&serviceTypes=Regular"
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Night",
|
||||
"uri": "/Line/Route?ids=Piccadilly&serviceTypes=Night"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "tfl-rail",
|
||||
"name": "TfL Rail",
|
||||
"modeName": "tflrail",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.657Z",
|
||||
"modified": "2017-06-28T11:43:10.657Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=TfL Rail&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "victoria",
|
||||
"name": "Victoria",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.607Z",
|
||||
"modified": "2017-06-28T11:43:10.607Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Victoria&serviceTypes=Regular"
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Night",
|
||||
"uri": "/Line/Route?ids=Victoria&serviceTypes=Night"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
|
||||
"id": "waterloo-city",
|
||||
"name": "Waterloo & City",
|
||||
"modeName": "tube",
|
||||
"disruptions": [],
|
||||
"created": "2017-06-28T11:43:10.703Z",
|
||||
"modified": "2017-06-28T11:43:10.703Z",
|
||||
"lineStatuses": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
|
||||
"id": 0,
|
||||
"statusSeverity": 10,
|
||||
"statusSeverityDescription": "Good Service",
|
||||
"created": "0001-01-01T00:00:00",
|
||||
"validityPeriods": []
|
||||
}
|
||||
],
|
||||
"routeSections": [],
|
||||
"serviceTypes": [
|
||||
{
|
||||
"$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
|
||||
"name": "Regular",
|
||||
"uri": "/Line/Route?ids=Waterloo & City&serviceTypes=Regular"
|
||||
}
|
||||
],
|
||||
"crowding": {
|
||||
"$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Add table
Reference in a new issue