protected AutomationBase(AutomationId id) { if (id == null) { throw new ArgumentNullException(nameof(id)); } Id = id; Settings = new SettingsContainer(StoragePath.WithFilename("Automations", id.Value, "Settings.json")); GeneralSettingsWrapper = new AutomationSettingsWrapper(Settings); }
protected ComponentBase(ComponentId id) { if (id == null) { throw new ArgumentNullException(nameof(id)); } Id = id; Settings = new SettingsContainer(StoragePath.WithFilename("Components", id.Value, "Settings.json")); GeneralSettingsWrapper = new ComponentSettingsWrapper(Settings); }
public SynonymServiceStorage() { var rootPath = StoragePath.WithFilename("Services", "SynonymService"); if (!Directory.Exists(rootPath)) { Directory.CreateDirectory(rootPath); } _areaSynonymsFilename = Path.Combine(rootPath, "Areas.json"); _componentSynonymsFilename = Path.Combine(rootPath, "Components.json"); _componentStateSynonymsFilename = Path.Combine(rootPath, "ComponentStates.json"); }
public ComponentStateHistoryTracker(IComponent component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } _component = component; _filename = StoragePath.WithFilename("Components", component.Id.Value, "History.csv"); StoragePath.EnsureDirectoryExists(_filename); component.StateChanged += CreateDataPointAsync; }
public static bool TryCreateFromDefaultConfigurationFile(out TelegramBotService telegramBotService) { string filename = StoragePath.WithFilename("TelegramBotConfiguration.json"); return(TryCreateFromConfigurationFile(filename, out telegramBotService)); }
private static string GenerateFilename(ActuatorId actuatorId) { return(StoragePath.WithFilename("Actuators", actuatorId.Value, "Configuration.json")); }