reconfigure a scene by scene ID
424652
def set_scene_color(self, scene_id, color):
        """"""
        if not scene_id in self.state.scenes: # does that scene_id exist?
            err_msg = "Requested to recolor scene {sceneNum}, which does not exist".format(sceneNum=scene_id)
            logging.info(err_msg)
            return(False, 0, err_msg)
        self.state.scenes[scene_id] = self.state.scenes[scene_id]._replace(color=color)
        sequence_number = self.zmq_publisher.publish_scene_color(scene_id, color)
        logging.debug("Recolored scene {sceneNum}".format(sceneNum=scene_id))
        if scene_id == self.state.activeSceneId:
            self.state.activeAnimation.set_color(color)
            self._do_next_frame() # TODO: make it more sensible, e.g. call only if static scene
        return (True, sequence_number, "OK")
531657
async def delete_shade_from_scene(self, shade_id, scene_id):
        """"""
        return await self.request.delete(
            self._base_path, params={ATTR_SCENE_ID: scene_id, ATTR_SHADE_ID: shade_id}
        )
508605
def publish_scene_color(self, scene_id, color):
        """"""
        self.sequence_number += 1
        self.publisher.send_multipart(msgs.MessageBuilder.scene_color(self.sequence_number, scene_id, color))
        return self.sequence_number
1030209
function setMode(oBinding, iIndex) {
				if (oBinding.parts) {
					oBinding.parts.forEach(function (vPart, i) {
						if (typeof vPart === "string") {
							vPart = oBinding.parts[i] = {path : vPart};
						}
						setMode(vPart, i);
					});
					b2ndLevelMergedNeeded = b2ndLevelMergedNeeded || iIndex !== undefined;
				} else {
					oBinding.mode = oBindingMode;
				}
			}
590523
def get_last_scene_id(self, refresh=False):
        
        if refresh:
            self.refresh_complex_value('LastSceneID')
            self.refresh_complex_value('sl_CentralScene')
        val = self.get_complex_value('LastSceneID') or self.get_complex_value('sl_CentralScene')
        return val
890913
def add_scene(self, animation_id, name, color, velocity, config):
        """"""
        # check arguments
        if animation_id < 0 or animation_id >= len(self.state.animationClasses):
            err_msg = "Requested to register scene with invalid Animation ID. Out of range."
            logging.info(err_msg)
            return(False, 0, err_msg)
        if self.state.animationClasses[animation_id].check_config(config) is False:
            err_msg = "Requested to register scene with invalid configuration."
            logging.info(err_msg)
            return(False, 0, err_msg)
        self.state.sceneIdCtr += 1
        self.state.scenes[self.state.sceneIdCtr] = Scene(animation_id, name, color, velocity, config)
        sequence_number = self.zmq_publisher.publish_scene_add(self.state.sceneIdCtr, animation_id, name, color, velocity, config)
        logging.debug("Registered new scene.")

        # set this scene as active scene if none is configured yet
        if self.state.activeSceneId is None:
            self.set_scene_active(self.state.sceneIdCtr)
        return (True, sequence_number, "OK")
713608
async def create_scene_member(self, shade_position, scene_id, shade_id):
        """"""

        data = {
            ATTR_SCENE_MEMBER: {
                ATTR_POSITION_DATA: shade_position,
                ATTR_SCENE_ID: scene_id,
                ATTR_SHADE_ID: shade_id,
            }
        }
        return await self.request.post(self._base_path, data=data)
517156
def scene_remove(sequence_number, scene_id):
        """"""
        return MessageWriter().string("scene.rm").uint64(sequence_number).uint32(scene_id).get()
1061962
function (name) {
        var scene = this._scene;
        if (scene) {
            var nodeRepository = scene._nodeRepository;
            delete nodeRepository[this.name];
            nodeRepository[name] = this;
        }
        this.name = name;
    }
477757
async def create_scene(self, scene_name, room_id) -> Scene:
        
        _raw = await self._scenes_entry_point.create_scene(room_id, scene_name)
        result = Scene(_raw, self.request)
        self.scenes.append(result)
        return result
31602
def _resampled_scene(self, new_scn, destination_area, reduce_data=True,
                         **resample_kwargs):
        """"""
        new_datasets = {}
        datasets = list(new_scn.datasets.values())
        if isinstance(destination_area, (str, six.text_type)):
            destination_area = get_area_def(destination_area)
        if hasattr(destination_area, 'freeze'):
            try:
                max_area = new_scn.max_area()
                destination_area = destination_area.freeze(max_area)
            except ValueError:
                raise ValueError("No dataset areas available to freeze "
                                 "DynamicAreaDefinition.")

        resamplers = {}
        reductions = {}
        for dataset, parent_dataset in dataset_walker(datasets):
            ds_id = DatasetID.from_dict(dataset.attrs)
            pres = None
            if parent_dataset is not None:
                pres = new_datasets[DatasetID.from_dict(parent_dataset.attrs)]
            if ds_id in new_datasets:
                replace_anc(new_datasets[ds_id], pres)
                if ds_id in new_scn.datasets:
                    new_scn.datasets[ds_id] = new_datasets[ds_id]
                continue
            if dataset.attrs.get('area') is None:
                if parent_dataset is None:
                    new_scn.datasets[ds_id] = dataset
                else:
                    replace_anc(dataset, pres)
                continue
            LOG.debug("Resampling %s", ds_id)
            source_area = dataset.attrs['area']
            try:
                if reduce_data:
                    key = source_area
                    try:
                        (slice_x, slice_y), source_area = reductions[key]
                    except KeyError:
                        slice_x, slice_y = source_area.get_area_slices(destination_area)
                        source_area = source_area[slice_y, slice_x]
                        reductions[key] = (slice_x, slice_y), source_area
                    dataset = self._slice_data(source_area, (slice_x, slice_y), dataset)
                else:
                    LOG.debug("Data reduction disabled by the user")
            except NotImplementedError:
                LOG.info("Not reducing data before resampling.")
            if source_area not in resamplers:
                key, resampler = prepare_resampler(
                    source_area, destination_area, **resample_kwargs)
                resamplers[source_area] = resampler
                self.resamplers[key] = resampler
            kwargs = resample_kwargs.copy()
            kwargs['resampler'] = resamplers[source_area]
            res = resample_dataset(dataset, destination_area, **kwargs)
            new_datasets[ds_id] = res
            if ds_id in new_scn.datasets:
                new_scn.datasets[ds_id] = res
            if parent_dataset is not None:
                replace_anc(res, pres)
335848
def scene_command(self, command):
        """"""
        self.logger.info("scene_command: Group %s Command %s", self.group_id, command)
        command_url = self.hub.hub_url + '/0?' + command + self.group_id + "=I=0"
        return self.hub.post_direct_command(command_url)
914991
def resample(self, destination=None, **kwargs):
        """"""
        return self._generate_scene_func(self._scenes, 'resample', True, destination=destination, **kwargs)
267450
def scene=(n)
      if n.nil?
        Kernel.raise IndexError, 'scene number out of bounds' unless @images.length.zero?
        @scene = nil
        return @scene
      elsif @images.length.zero?
        Kernel.raise IndexError, 'scene number out of bounds'
      end

      n = Integer(n)
      Kernel.raise IndexError, 'scene number out of bounds' if n < 0 || n > length - 1
      @scene = n
      @scene
    end
676899
async def set_action(self, on=None, bri=None, hue=None, sat=None, xy=None,
                         ct=None, alert=None, effect=None, transitiontime=None,
                         bri_inc=None, sat_inc=None, hue_inc=None, ct_inc=None,
                         xy_inc=None, scene=None):
        """"""
        data = {
            key: value for key, value in {
                'on': on,
                'bri': bri,
                'hue': hue,
                'sat': sat,
                'xy': xy,
                'ct': ct,
                'alert': alert,
                'effect': effect,
                'transitiontime': transitiontime,
                'bri_inc': bri_inc,
                'sat_inc': sat_inc,
                'hue_inc': hue_inc,
                'ct_inc': ct_inc,
                'xy_inc': xy_inc,
                'scene': scene,
            }.items() if value is not None
        }

        await self._request('put', 'groups/{}/action'.format(self.id),
                            json=data)
389591
async def create_scene(self, room_id, name, color_id=0, icon_id=0):
        
        name = unicode_to_base64(name)
        _data = {
            "scene": {
                ATTR_ROOM_ID: room_id,
                ATTR_NAME: name,
                ATTR_COLOR_ID: color_id,
                ATTR_ICON_ID: icon_id,
            }
        }
        _response = await self.request.post(self._base_path, data=_data)
        return _response
579471
async def activate(self):
        """"""
        _val = await self.request.get(self._base_path, params={ATTR_SCENE_ID: self._id})
        return _val