Exemplo n.º 1
0
        public static int InitializeData()
        {
            Storage.IntializeDefaultScenes();
            AddressBuild.InitializeVar(Platform.ReadSetting("bridgeIP"), Platform.ReadSetting("bridgeUserName"), Platform.ReadSetting("bridgeGroup"));
            activeTab = Platform.ReadSetting("lastActiveTab");
            sceneData = JsonParser.Deserialize(Platform.ReadSetting("customSceneJSON"));

            latestData      = JsonParser.Deserialize(Platform.ReadSetting("backupMainJSON"));
            groupData       = JsonParser.Deserialize(Platform.ReadSetting("backupGroupJSON"));
            backupData      = latestData;
            groupBackupData = groupData;

            SunriseEquation.SetCoordinates();
            SunriseEquation.SunriseSunset();

            System.Reflection.Assembly         assembly    = System.Reflection.Assembly.GetExecutingAssembly();
            System.Diagnostics.FileVersionInfo versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
            fileVersion[0] = versionInfo.ProductMajorPart;
            fileVersion[1] = versionInfo.ProductMinorPart;
            fileVersion[2] = versionInfo.ProductBuildPart;
            fileVersion[3] = versionInfo.ProductPrivatePart;

            var result = RefreshData();

            var bridgeResult = FindNewBridgeIP();

            Effects.AutoEffect();
            var bridgeResult2 = StoreBridgeID();

            return(0);
        }
Exemplo n.º 2
0
        public static int ReinitializeData()         //Should be called when changing groups.
        {
            AddressBuild.InitializeVar(Platform.ReadSetting("bridgeIP"), Platform.ReadSetting("bridgeUserName"), Platform.ReadSetting("bridgeGroup"));
            var result = RefreshData();

            return(0);
        }