public SetPumpScheduleCommand(ILogger <SetPumpScheduleCommand> logger, HassMqttManager hassMqttManager, FeatureUpdateManager updateManager, BlueClient blueClient)
 {
     _logger          = logger;
     _hassMqttManager = hassMqttManager;
     _updateManager   = updateManager;
     _blueClient      = blueClient;
 }
Exemplo n.º 2
0
 public SingleBlueRiiotPoolUpdaterFactory(ILoggerFactory loggerFactory, HassMqttManager hassMqttManager, FeatureUpdateManager updateManager, BlueClient blueClient, IOptions <BlueRiiotConfiguration> config)
 {
     _loggerFactory   = loggerFactory;
     _hassMqttManager = hassMqttManager;
     _updateManager   = updateManager;
     _blueClient      = blueClient;
     _config          = config.Value;
 }
        public SingleBlueRiiotPoolUpdater(ILogger logger, HassMqttManager hassMqttManager, FeatureUpdateManager updateManager, BlueClient blueClient, BlueRiiotConfiguration config, SwimmingPool pool)
        {
            _logger          = logger;
            _hassMqttManager = hassMqttManager;
            _pool            = pool;
            _updateManager   = updateManager;
            _blueClient      = blueClient;
            _config          = config;
            _delayCalculator = new DelayCalculator(_logger, config, pool.Name);

            _backgroundTask = new Task(async() => await Run(), _stoppingToken.Token);
        }
        public async Task LoginIfNeeded(BlueClient client, CancellationToken token = default)
        {
            if (_creds != null && DateTime.UtcNow < _creds.Expiration.AddMinutes(-5))
            {
                return;
            }

            // Re-login
            LoginResponse credentials = await client.LoginWithUsernamePassword(_username, _password, token);

            _creds = credentials.Credentials;
            _immutableCredentials = new ImmutableCredentials(_creds.AccessKey, _creds.SecretKey, _creds.SessionToken);
        }
 public BlueRiiotMqttService(
     ILogger <BlueRiiotMqttService> logger,
     IOptions <BlueRiiotConfiguration> config,
     BlueClient blueClient,
     HassMqttManager hassMqttManager,
     SingleBlueRiiotPoolUpdaterFactory updaterFactory)
 {
     _logger          = logger;
     _blueClient      = blueClient;
     _hassMqttManager = hassMqttManager;
     _updaterFactory  = updaterFactory;
     _config          = config.Value;
 }
Exemplo n.º 6
0
 public ReleaseLastUnprocessedCommand(ILogger <ReleaseLastUnprocessedCommand> logger, BlueClient client, BlueRiiotMqttService service)
 {
     _logger  = logger;
     _client  = client;
     _service = service;
 }