How to use the yeelight.enums.PowerMode 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 / tests.py View on Github external
def test_turn_on4(self):
        self.bulb.power_mode = enums.PowerMode.MOONLIGHT
        self.bulb.turn_on()
        self.assertEqual(self.socket.sent["method"], "set_power")
        self.assertEqual(self.socket.sent["params"], ["on", "smooth", 300, enums.PowerMode.MOONLIGHT.value])
github skorokithakis / python-yeelight / yeelight / tests.py View on Github external
def test_turn_on4(self):
        self.bulb.power_mode = enums.PowerMode.MOONLIGHT
        self.bulb.turn_on()
        self.assertEqual(self.socket.sent["method"], "set_power")
        self.assertEqual(self.socket.sent["params"], ["on", "smooth", 300, enums.PowerMode.MOONLIGHT.value])
github home-assistant / home-assistant / homeassistant / components / yeelight / light.py View on Github external
"color1": BulbType.Color,
    "color2": BulbType.Color,
    "strip1": BulbType.Color,
    "bslamp1": BulbType.Color,
    "RGBW": BulbType.Color,
    "lamp1": BulbType.WhiteTemp,
    "ceiling1": BulbType.WhiteTemp,
    "ceiling2": BulbType.WhiteTemp,
    "ceiling3": BulbType.WhiteTemp,
    "ceiling4": BulbType.WhiteTempMood,
}

VALID_BRIGHTNESS = vol.All(vol.Coerce(int), vol.Range(min=1, max=100))

SERVICE_SCHEMA_SET_MODE = YEELIGHT_SERVICE_SCHEMA.extend(
    {vol.Required(ATTR_MODE): vol.In([mode.name.lower() for mode in PowerMode])}
)

SERVICE_SCHEMA_START_FLOW = YEELIGHT_SERVICE_SCHEMA.extend(
    YEELIGHT_FLOW_TRANSITION_SCHEMA
)

SERVICE_SCHEMA_SET_COLOR_SCENE = YEELIGHT_SERVICE_SCHEMA.extend(
    {
        vol.Required(ATTR_RGB_COLOR): vol.All(
            vol.ExactSequence((cv.byte, cv.byte, cv.byte)), vol.Coerce(tuple)
        ),
        vol.Required(ATTR_BRIGHTNESS): VALID_BRIGHTNESS,
    }
)

SERVICE_SCHEMA_SET_HSV_SCENE = YEELIGHT_SERVICE_SCHEMA.extend(