diff --git a/homeassistant/components/binary_sensor/digital_ocean.py b/homeassistant/components/binary_sensor/digital_ocean.py index 31f29597f06..ea02196f3eb 100644 --- a/homeassistant/components/binary_sensor/digital_ocean.py +++ b/homeassistant/components/binary_sensor/digital_ocean.py @@ -36,6 +36,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): dev = [] for droplet in droplets: droplet_id = digital_ocean.DIGITAL_OCEAN.get_droplet_id(droplet) + if droplet_id is None: + _LOGGER.error("Droplet %s is not available", droplet) + return False dev.append(DigitalOceanBinarySensor( digital_ocean.DIGITAL_OCEAN, droplet_id)) diff --git a/homeassistant/components/switch/digital_ocean.py b/homeassistant/components/switch/digital_ocean.py index 11414ce96c5..066a356ba7b 100644 --- a/homeassistant/components/switch/digital_ocean.py +++ b/homeassistant/components/switch/digital_ocean.py @@ -35,6 +35,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None): dev = [] for droplet in droplets: droplet_id = digital_ocean.DIGITAL_OCEAN.get_droplet_id(droplet) + if droplet_id is None: + _LOGGER.error("Droplet %s is not available", droplet) + return False dev.append(DigitalOceanSwitch( digital_ocean.DIGITAL_OCEAN, droplet_id))