From fde4a7d029bd5983ae6dbb9541082c5a88cd82e3 Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Mon, 17 Jul 2017 22:50:55 +0200 Subject: [PATCH] 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 --- homeassistant/components/sensor/citybikes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/citybikes.py b/homeassistant/components/sensor/citybikes.py index 15046897732..4cb532d26eb 100644 --- a/homeassistant/components/sensor/citybikes.py +++ b/homeassistant/components/sensor/citybikes.py @@ -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,