Exemple #1
0
        public async Task IAGetInstalledAppAsync_ShouldReturnExpectedResult(InstalledAppInstance installedApp)
        {
            var result = await _installedAppManager.GetInstalledAppAsync(installedApp.InstalledAppId);

            Assert.NotNull(result);
            Assert.Equal(installedApp.InstalledAppId, result.InstalledAppId);
            Assert.Equal(installedApp.InstalledLocation, result.InstalledLocation);
        }
Exemple #2
0
        public async Task DeviceCommandAsync(string installedAppId,
                                             string deviceId,
                                             dynamic command)
        {
            _ = installedAppId ?? throw new ArgumentNullException(nameof(installedAppId));
            _ = deviceId ?? throw new ArgumentNullException(nameof(deviceId));
            _ = command ?? throw new ArgumentNullException(nameof(command));

            try
            {
                var installedApp = await _installedAppManager.GetInstalledAppAsync(installedAppId).ConfigureAwait(false);

                await _smartThingsAPIHelper.DeviceCommandAsync(installedApp, deviceId, command);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Exception calling smartThingsAPIHelper.DeviceCommandAsync");
                throw;
            }
        }