platypush/plugins/light/hue/__init__.py
def delta_sat(self, delta, lights=None, groups=None, **kwargs):
        """
        Change lights/groups saturation 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: Saturation delta value (range: -100, 100)
        """

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

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

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

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

        Change lights/groups saturation 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: Saturation delta value (range: -100, 100)
        
Change lights/groups saturation by a delta [-100, 100] compared to the current state.
Change lights / groups saturation by a delta [ - 100 100 ] compared to the current state .
def delta_sat(self, delta, lights=None, groups=None, **kwargs):
        if groups is None:
            groups = []
        if lights is None:
            lights = []
        if lights:
            sat = statistics.mean([
                light['state']['sat']
                for light in self.bridge.get_light().values()
                if light['name'] in lights
            ])
        elif groups:
            sat = statistics.mean([
                group['action']['sat']
                for group in self.bridge.get_group().values()
                if group['name'] in groups
            ])
        else:
            sat = statistics.mean([
                light['state']['sat']
                for light in self.bridge.get_light().values()
                if light['name'] in self.lights
            ])
        delta *= (self.MAX_SAT / 100)
        if sat + delta < 0:
            sat = 0
        elif sat + delta > self.MAX_SAT:
            sat = self.MAX_SAT
        else:
            sat += delta
        return self._exec('sat', int(sat), lights=lights, groups=groups, **kwargs)
def delta_sat ( self , delta , lights = None , groups = None , ** kwargs ) : if groups is None : groups = [ ] if lights is None : lights = [ ] if lights : sat = statistics . mean ( [ light [ 'state' ] [ 'sat' ] for light in self . bridge . get_light ( ) . values ( ) if light [ 'name' ] in lights ] ) elif groups : sat = statistics . mean ( [ group [ 'action' ] [ 'sat' ] for group in self . bridge . get_group ( ) . values ( ) if group [ 'name' ] in groups ] ) else : sat = statistics . mean ( [ light [ 'state' ] [ 'sat' ] for light in self . bridge . get_light ( ) . values ( ) if light [ 'name' ] in self . lights ] ) delta *= ( self . MAX_SAT / 100 ) if sat + delta < 0 : sat = 0 elif sat + delta > self . MAX_SAT : sat = self . MAX_SAT else : sat += delta return self . _exec ( 'sat' , int ( sat ) , lights = lights , groups = groups , ** kwargs )
Change lights/groups saturation by a delta [-100, 100] compared to the current state.
Change lights / groups saturation by a delta [ - 100 100 ] compared to the current state .
"""
        Change lights/groups saturation 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: Saturation delta value (range: -100, 100)
        """
self
delta
Saturation delta value (range: -100, 100)
Saturation delta value ( range : - 100 100 )
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