Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
self.bulbs = yeelight.discover_bulbs()
def get_bulb(self):
from yeelight import Bulb, discover_bulbs
ip = self.component.ip
if not ip:
devices = discover_bulbs()
list_devices(devices)
ip = devices[0]['ip']
return Bulb(ip)