def set_mode(self, mode: str):
    'Set a power mode.'
    import yeelight
    try:
        self._bulb.set_power_mode(yeelight.enums.PowerMode[mode.upper()])
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to set the power mode: %s', ex)
Set a power mode.
def set_mode(self, mode: str):
    
    import yeelight
    try:
        self._bulb.set_power_mode(yeelight.enums.PowerMode[mode.upper()])
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to set the power mode: %s', ex)