How to use the yeelight.main.BulbType function in yeelight

To help you get started, we’ve selected a few yeelight examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skorokithakis / python-yeelight / yeelight / main.py View on Github external
"""
        The type of bulb we're communicating with.

        Returns a :py:class:`BulbType ` describing the bulb
        type.

        When trying to access before properties are known, the bulb type is unknown.

        :rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color
github davidramiro / fluxee / yeelight / main.py View on Github external
"""
        The type of bulb we're communicating with.

        Returns a :py:class:`BulbType ` describing the bulb
        type.

        When trying to access before properties are known, the bulb type is unknown.

        :rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color
github davidramiro / fluxee / yeelight / main.py View on Github external
def bulb_type(self):
        """
        The type of bulb we're communicating with.

        Returns a :py:class:`BulbType ` describing the bulb
        type.

        When trying to access before properties are known, the bulb type is unknown.

        :rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color
github skorokithakis / python-yeelight / yeelight / main.py View on Github external
:rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color
github skorokithakis / python-yeelight / yeelight / main.py View on Github external
def bulb_type(self):
        """
        The type of bulb we're communicating with.

        Returns a :py:class:`BulbType ` describing the bulb
        type.

        When trying to access before properties are known, the bulb type is unknown.

        :rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color
github davidramiro / fluxee / yeelight / main.py View on Github external
:rtype: yeelight.BulbType
        :return: The bulb's type.
        """
        if not self._last_properties or any(name not in self.last_properties for name in ["ct", "rgb"]):
            return BulbType.Unknown
        if self.last_properties["rgb"] is None and self.last_properties["ct"]:
            if self.last_properties["bg_power"] is not None:
                return BulbType.WhiteTempMood
            else:
                return BulbType.WhiteTemp
        if all(
            name in self.last_properties and self.last_properties[name] is None for name in ["ct", "rgb", "hue", "sat"]
        ):
            return BulbType.White
        else:
            return BulbType.Color