public SetSetpointCommand(ILogger <SetSetpointCommand> logger, UhomeUponorClient client, FeatureManager featureManager, HassMqttManager hassMqttManager) { _logger = logger; _client = client; _featureManager = featureManager; _hassMqttManager = hassMqttManager; }
public static async Task <(bool, UponorResponseContainer)> WaitUntil(this UhomeUponorClient client, int @object, UponorProperties property, Func <UponorResponseContainer, bool> condition, CancellationToken token = default) { UponorResponseContainer res = new UponorResponseContainer(); try { while (!token.IsCancellationRequested) { // Attempt to read the value res = await client.ReadValue(@object, property, token); bool conditionMet = condition(res); if (conditionMet) { return(true, res); } // Condition was not met, carry on await Task.Delay(TimeSpan.FromMilliseconds(500), token); } } catch (TaskCanceledException) { return(false, res); } return(false, res); }
public UponorConnectedService(HassMqttManager hassMqttManager, UhomeUponorClient uponorClient) { _hassMqttManager = hassMqttManager; _uponorClient = uponorClient; _version = typeof(Program).Assembly.GetName().Version.ToString(3); }
public UponorThermostatsService( ILogger <UponorThermostatsService> logger, IOptions <UponorConfiguration> config, FeatureManager featureManager, UhomeUponorClient uponorClient, HassMqttManager hassMqttManager, SystemDetailsContainer detailsContainer) { _logger = logger; _featureManager = featureManager; _uponorClient = uponorClient; _hassMqttManager = hassMqttManager; _detailsContainer = detailsContainer; _config = config.Value; }
public UponorDiscoveryService( ILogger <UponorDiscoveryService> logger, IOptions <UponorConfiguration> config, IOptions <UponorOperationConfiguration> operationConfig, FeatureManager featureManager, UhomeUponorClient uponorClient, SystemDetailsContainer detailsContainer, HassMqttManager hassMqttManager) { _logger = logger; _operationConfig = operationConfig.Value; _uponorClient = uponorClient; _featureManager = featureManager; _detailsContainer = detailsContainer; _hassMqttManager = hassMqttManager; _config = config.Value; }