public static IHomeAssistantMqttConfigurationBuilder AddAlarmControlPanel( this IHomeAssistantMqttConfigurationBuilder configurationBuilder, IAlarmControlPanelMqttEntityConfiguration mqttEntityConfiguration) { configurationBuilder.TryRegisterStatefulEntityBindingManager <IAlarmControlPanelMqttEntityConfiguration, IAlarmControlPanel, IAlarmControlPanelEntityDefinition>(); configurationBuilder.ServiceCollection.AddSingleton(mqttEntityConfiguration); return(configurationBuilder); }
public static IHomeAssistantMqttConfigurationBuilder AddBinarySensor( this IHomeAssistantMqttConfigurationBuilder configurationBuilder, IBinarySensorMqttEntityConfiguration mqttEntityConfiguration) { configurationBuilder.TryRegisterStatefulEntityBindingManager <IBinarySensorMqttEntityConfiguration, IBinarySensor, IBinarySensorEntityDefinition>(); configurationBuilder.ServiceCollection.AddSingleton(mqttEntityConfiguration); return(configurationBuilder); }
public static IHomeAssistantMqttConfigurationBuilder AddBinarySensor( this IHomeAssistantMqttConfigurationBuilder configurationBuilder, Func <IBinarySensorMqttEntityConfigurationBuilder, IBinarySensorMqttEntityConfigurationBuilder> configurator) { configurationBuilder.TryRegisterStatefulEntityBindingManager <IBinarySensorMqttEntityConfiguration, IBinarySensor, IBinarySensorEntityDefinition>(); IBinarySensorMqttEntityConfigurationBuilder builder = new BinarySensorMqttEntityConfigurationBuilder(); builder = configurator(builder); configurationBuilder.ServiceCollection.AddSingleton(sp => { var entityConfiguration = builder.Build(); return(entityConfiguration); }); return(configurationBuilder); }
public static IHomeAssistantMqttConfigurationBuilder AddAlarmControlPanel( this IHomeAssistantMqttConfigurationBuilder configurationBuilder, Func <IAlarmControlPanelMqttEntityConfigurationBuilder, IAlarmControlPanelMqttEntityConfigurationBuilder> configurator) { configurationBuilder.TryRegisterStatefulEntityBindingManager <IAlarmControlPanelMqttEntityConfiguration, IAlarmControlPanel, IAlarmControlPanelEntityDefinition>(); IAlarmControlPanelMqttEntityConfigurationBuilder builder = new AlarmControlPanelMqttEntityConfigurationBuilder(); builder = configurator(builder); configurationBuilder.ServiceCollection.AddSingleton(sp => { IAlarmControlPanelMqttEntityConfiguration entityConfiguration = builder.Build(); return(entityConfiguration); }); return(configurationBuilder); }