コード例 #1
0
        private void LoadControllerSettings()
        {
            var settings = new ControllerSettings(StoragePath.WithFilename("Configuration.json"), Logger);

            settings.Load();

            Settings = settings;
        }
コード例 #2
0
        protected void InitializeAzureCloudApiEndpoint()
        {
            var azureCloudApiDispatcherEndpoint = new AzureCloudApiDispatcherEndpoint();

            azureCloudApiDispatcherEndpoint.TryInitializeFromConfigurationFile(
                StoragePath.WithFilename("AzureCloudApiDispatcherEndpointSettings.json"));

            ApiController.RegisterEndpoint(azureCloudApiDispatcherEndpoint);
        }
コード例 #3
0
        private void LoadControllerSettings()
        {
            Settings = new SettingsContainer(StoragePath.WithFilename("Settings.json"));

            Settings.SetValue("Name", "HA4IoT Controller");
            Settings.SetValue("Description", "The HA4IoT controller which is responsible for this house.");

            Settings.Load();
        }
コード例 #4
0
        public Area(AreaId id, IController controller)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            Id         = id;
            Controller = controller;

            Settings = new SettingsContainer(StoragePath.WithFilename("Areas", id.Value, "Settings.json"));
            GeneralSettingsWrapper = new AreaSettingsWrapper(Settings);
        }
コード例 #5
0
        private void InitializeHttpApiEndpoint()
        {
            _httpServer = new HttpServer();

            var httpApiDispatcherEndpoint = new LocalHttpServerApiDispatcherEndpoint(_httpServer);

            ApiController.RegisterEndpoint(httpApiDispatcherEndpoint);

            var httpRequestDispatcher = new HttpRequestDispatcher(_httpServer);

            httpRequestDispatcher.MapFolder("App", StoragePath.WithFilename("App"));
            httpRequestDispatcher.MapFolder("Storage", StoragePath.Root);
        }