/// <summary>
        /// Ctor
        /// </summary>
        public ControllerBase(HspiBase2 plugin)
        {
            this.plugin = plugin;
            // Keep local HS separate from plugin.HS
            // It will be set to null when connection with HS is lost
            // And reset to the new HS when connection is restored
            // But only after UpdateConfiguration is completed!
            HS = plugin.HS;

            UpdateDeviceList();
            CheckAndCreateDevices();
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HikAlarmPageBuilder"/> class.
        /// </summary>
        /// <param name="pagename">The name used by HomeSeer when referencing this particular page.</param>
        /// <param name="plugin"></param>
        /// <param name="register">Don't RegisterWebPage for "deviceutility" page</param>
        /// <param name="config">RegisterConfigLink for "manage Interfaces" page</param>
        public PageBuilder(string pagename, HspiBase2 plugin, bool register = true, bool config = false) : base(pagename)
        {
            UsesJqAll = false;

            this.plugin    = plugin;
            gLocLabel      = hs.GetINISetting("Settings", "gLocLabel", "");
            gLocLabel2     = hs.GetINISetting("Settings", "gLocLabel2", "");
            bUseLocation2  = "True" == hs.GetINISetting("Settings", "bUseLocation2", "");
            bLocationFirst = "True" == hs.GetINISetting("Settings", "bLocationFirst", "");
            if (bLocationFirst)
            {
                LocationLabels = Tuple.Create(gLocLabel, gLocLabel2);
            }
            else
            {
                LocationLabels = Tuple.Create(gLocLabel2, gLocLabel);
            }

            if (register || config)
            {
                RegisterWebPage(config);
            }
        }