How to use the yeelight.transitions.pulse 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 home-assistant / home-assistant / homeassistant / components / yeelight / light.py View on Github external
EFFECT_LSD: yee_transitions.lsd,
                EFFECT_SLOWDOWN: yee_transitions.slowdown,
            }

            if effect in self.custom_effects_names:
                flow = Flow(**self.custom_effects[effect])
            elif effect in effects_map:
                flow = Flow(count=0, transitions=effects_map[effect]())
            elif effect == EFFECT_FAST_RANDOM_LOOP:
                flow = Flow(
                    count=0, transitions=yee_transitions.randomloop(duration=250)
                )
            elif effect == EFFECT_WHATSAPP:
                flow = Flow(count=2, transitions=yee_transitions.pulse(37, 211, 102))
            elif effect == EFFECT_FACEBOOK:
                flow = Flow(count=2, transitions=yee_transitions.pulse(59, 89, 152))
            elif effect == EFFECT_TWITTER:
                flow = Flow(count=2, transitions=yee_transitions.pulse(0, 172, 237))

            try:
                self._bulb.start_flow(flow, light_type=self.light_type)
            except BulbException as ex:
                _LOGGER.error("Unable to set effect: %s", ex)
github home-assistant / home-assistant / homeassistant / components / yeelight / light.py View on Github external
}

            if effect in self.custom_effects_names:
                flow = Flow(**self.custom_effects[effect])
            elif effect in effects_map:
                flow = Flow(count=0, transitions=effects_map[effect]())
            elif effect == EFFECT_FAST_RANDOM_LOOP:
                flow = Flow(
                    count=0, transitions=yee_transitions.randomloop(duration=250)
                )
            elif effect == EFFECT_WHATSAPP:
                flow = Flow(count=2, transitions=yee_transitions.pulse(37, 211, 102))
            elif effect == EFFECT_FACEBOOK:
                flow = Flow(count=2, transitions=yee_transitions.pulse(59, 89, 152))
            elif effect == EFFECT_TWITTER:
                flow = Flow(count=2, transitions=yee_transitions.pulse(0, 172, 237))

            try:
                self._bulb.start_flow(flow, light_type=self.light_type)
            except BulbException as ex:
                _LOGGER.error("Unable to set effect: %s", ex)