public void InitializeRooms(LightSystemSettings systemSettings)
        {
            foreach (SerializationRoom room in systemSettings.rooms)
            {
                var roomId = SettingsManager.ConvertStringNumberToInt(room.id);


                // var loadId = SettingsManager.ConvertStringNumberToInt(load.id);

                LightedRoom lightedRoom = new LightedRoom(roomId, room.name);

                List <int> loadIds = null;

                if (!String.IsNullOrEmpty(room.loadList))
                {
                    if (room.loadList == "all")
                    {
                        loadIds = _loadManager.GetLoads().Select(x => x.LoadID).ToList <int>();
                    }
                    else
                    {
                        loadIds = new List <int>(room.loadList.Split(',').Select(s => int.Parse(s)));
                    }

                    foreach (int loadId in loadIds)
                    {
                        lightedRoom.AddLoad(_loadManager.GetLoad(loadId));
                    }
                }

                if (!String.IsNullOrEmpty(room.sceneList))
                {
                    var sceneIds = new List <int>(room.sceneList.Split(',').Select(s => int.Parse(s)));

                    foreach (int sceneId in sceneIds)
                    {
                        Scene scene = _sceneManager.GetScene(sceneId);
                        scene.AssignRoom(lightedRoom);
                        lightedRoom.AddScene(scene);
                    }
                }

                _roomManager.AddRoom(lightedRoom);
            }
        }
        public void InitializeScenes(LightSystemSettings systemSettings)
        {
            foreach (SerializationScene scene in systemSettings.scenes)
            {
                var id = SettingsManager.ConvertStringNumberToInt(scene.id);

                Scene lightScene = new Scene(id, scene.name);

                if (scene.wholeHome)
                {
                    lightScene.WholeHome = true;
                }

                foreach (SerializationLoadState loadState in scene.loadStates)
                {
                    var level = SettingsManager.ConvertUnsignedStringNumber(loadState.level);

                    List <int> loadIds = null;

                    if (loadState.loadList == "all")
                    {
                        loadIds = _loadManager.GetLoads().Select(x => x.LoadID).ToList <int>();
                    }
                    else
                    {
                        loadIds = new List <int>(loadState.loadList.Split(',').Select(s => int.Parse(s)));
                    }

                    foreach (int loadID in loadIds)
                    {
                        LoadState state = new LoadState((ushort)level, LoadManager.GetLoad(loadID));
                        lightScene.AddLoadState(state);
                    }
                }

                _sceneManager.AddScene(lightScene);
            }
        }