platypush/plugins/light/hue/__init__.py
def delta_hue(self, delta, lights=None, groups=None, **kwargs):
        """
        Change lights/groups hue by a delta [-100, 100] compared to the current state.

        :param lights: Lights to control (names or light objects). Default: plugin default lights
        :param groups: Groups to control (names or group objects). Default: plugin default groups
        :param delta: Hue delta value (range: -100, 100)
        """

        if groups is None:
            groups = []
        if lights is None:
            lights = []

        if lights:
            hue = statistics.mean([
                light['state']['hue']
                for light in self.bridge.get_light().values()
                if light['name'] in lights
            ])
        elif groups:
            hue = statistics.mean([
                group['action']['hue']
                for group in self.bridge.get_group().values()
                if group['name'] in groups
            ])
        else:
            hue = statistics.mean([
                light['state']['hue']
                for light in self.bridge.get_light().values()
                if light['name'] in self.lights
            ])

        delta *= (self.MAX_HUE / 100)
        if hue + delta < 0:
            hue = 0
        elif hue + delta > self.MAX_HUE:
            hue = self.MAX_HUE
        else:
            hue += delta

        return self._exec('hue', int(hue), lights=lights, groups=groups, **kwargs)

        Change lights/groups hue by a delta [-100, 100] compared to the current state.

        :param lights: Lights to control (names or light objects). Default: plugin default lights
        :param groups: Groups to control (names or group objects). Default: plugin default groups
        :param delta: Hue delta value (range: -100, 100)
        
Change lights/groups hue by a delta [-100, 100] compared to the current state.
Change lights / groups hue by a delta [ - 100 100 ] compared to the current state .
def delta_hue(self, delta, lights=None, groups=None, **kwargs):
        if groups is None:
            groups = []
        if lights is None:
            lights = []
        if lights:
            hue = statistics.mean([
                light['state']['hue']
                for light in self.bridge.get_light().values()
                if light['name'] in lights
            ])
        elif groups:
            hue = statistics.mean([
                group['action']['hue']
                for group in self.bridge.get_group().values()
                if group['name'] in groups
            ])
        else:
            hue = statistics.mean([
                light['state']['hue']
                for light in self.bridge.get_light().values()
                if light['name'] in self.lights
            ])
        delta *= (self.MAX_HUE / 100)
        if hue + delta < 0:
            hue = 0
        elif hue + delta > self.MAX_HUE:
            hue = self.MAX_HUE
        else:
            hue += delta
        return self._exec('hue', int(hue), lights=lights, groups=groups, **kwargs)
def delta_hue ( self , delta , lights = None , groups = None , ** kwargs ) : if groups is None : groups = [ ] if lights is None : lights = [ ] if lights : hue = statistics . mean ( [ light [ 'state' ] [ 'hue' ] for light in self . bridge . get_light ( ) . values ( ) if light [ 'name' ] in lights ] ) elif groups : hue = statistics . mean ( [ group [ 'action' ] [ 'hue' ] for group in self . bridge . get_group ( ) . values ( ) if group [ 'name' ] in groups ] ) else : hue = statistics . mean ( [ light [ 'state' ] [ 'hue' ] for light in self . bridge . get_light ( ) . values ( ) if light [ 'name' ] in self . lights ] ) delta *= ( self . MAX_HUE / 100 ) if hue + delta < 0 : hue = 0 elif hue + delta > self . MAX_HUE : hue = self . MAX_HUE else : hue += delta return self . _exec ( 'hue' , int ( hue ) , lights = lights , groups = groups , ** kwargs )
Change lights/groups hue by a delta [-100, 100] compared to the current state.
Change lights / groups hue by a delta [ - 100 100 ] compared to the current state .
"""
        Change lights/groups hue by a delta [-100, 100] compared to the current state.

        :param lights: Lights to control (names or light objects). Default: plugin default lights
        :param groups: Groups to control (names or group objects). Default: plugin default groups
        :param delta: Hue delta value (range: -100, 100)
        """
self
delta
None
lights
Lights to control (names or light objects). Default: plugin default lights
Lights to control ( names or light objects ) . Default : plugin default lights
groups
Groups to control (names or group objects). Default: plugin default groups
Groups to control ( names or group objects ) . Default : plugin default groups