Check if droplet exists (#6663)
* Check if droplet exists * Add droplet to message and remove elsepull/6665/head
parent
a2365eccf6
commit
1ab47b5d2b
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in New Issue