Esempio n. 1
0
    def __init__(self, device):
        """Initialize the light."""

        self._name = device["name"]
        self._address = device["address"]
        self.is_valid = True
        self._bulb = zengge(self._address)
        self._white = 0
        self._brightness = 0
        self._hs_color = (0, 0)
        self._state = False
        if self._bulb.connect() is False:
            self.is_valid = False
            _LOGGER.error("Failed to connect to bulb %s, %s", self._address, self._name)
            return
Esempio n. 2
0
    def __init__(self, device):
        """Initialize the light."""
        import zengge

        self._name = device["name"]
        self._address = device["address"]
        self.is_valid = True
        self._bulb = zengge.zengge(self._address)
        self._white = 0
        self._rgb = (0, 0, 0)
        self._state = False
        if self._bulb.connect() is False:
            self.is_valid = False
            _LOGGER.error("Failed to connect to bulb %s, %s", self._address, self._name)
            return
        self.update()
Esempio n. 3
0
    def __init__(self, device):
        """Initialize the light."""
        import zengge

        self._name = device['name']
        self._address = device['address']
        self.is_valid = True
        self._bulb = zengge.zengge(self._address)
        self._white = 0
        self._rgb = (0, 0, 0)
        self._state = False
        if self._bulb.connect() is False:
            self.is_valid = False
            _LOGGER.error("Failed to connect to bulb %s, %s", self._address,
                          self._name)
            return
Esempio n. 4
0
File: light.py Progetto: jbouwh/core
    def __init__(self, device):
        """Initialize the light."""

        self._attr_name = device["name"]
        self._attr_unique_id = device["address"]
        self.is_valid = True
        self._bulb = zengge(device["address"])
        self._white = 0
        self._attr_brightness = 0
        self._attr_hs_color = (0, 0)
        self._attr_is_on = False
        if self._bulb.connect() is False:
            self.is_valid = False
            _LOGGER.error("Failed to connect to bulb %s, %s",
                          device["address"], device["name"])
            return
Esempio n. 5
0
    def __init__(self, device):
        """Initialize the light."""
        import zengge

        self._name = device['name']
        self._address = device['address']
        self.is_valid = True
        self._bulb = zengge.zengge(self._address)
        self._white = 0
        self._brightness = 0
        self._hs_color = (0, 0)
        self._state = False
        if self._bulb.connect() is False:
            self.is_valid = False
            _LOGGER.error(
                "Failed to connect to bulb %s, %s", self._address, self._name)
            return