Citybikes: Allow None as result for empty slots (#8528)

The citibykes API returns "null" as value for empty_slots on some
stations (see #8527). This causes the component to not process the data.

This is fixed by accepting None as valid data. The row in the frontend
is left empty if "null" was returned by the service.

fixes #8527
This commit is contained in:
Jan Losinski authored and Fabian Affolter committed 2017-07-17 22:50:55 +02:00
1 parent b83ff739bc
commit fde4a7d029
1 file changed
+1 -1
+1 -1
View File
@@ -82,7 +82,7 @@ NETWORKS_RESPONSE_SCHEMA = vol.Schema({
STATION_SCHEMA = vol.Schema({
vol.Required(ATTR_FREE_BIKES): cv.positive_int,
vol.Required(ATTR_EMPTY_SLOTS): cv.positive_int,
vol.Required(ATTR_EMPTY_SLOTS): vol.Any(cv.positive_int, None),
vol.Required(ATTR_LATITUDE): cv.latitude,
vol.Required(ATTR_LONGITUDE): cv.latitude,
vol.Required(ATTR_ID): cv.string,