public async Task TestSetSwitchOn() { string id = "0e87a17f-5995-45ba-810d-37b1710acf46"; TransactionResponse result = await _client.SetBooleanCapability(id, "onoff", true); Assert.NotNull(result); Assert.False(string.IsNullOrEmpty(result.TransactionId)); Assert.False(string.IsNullOrEmpty(result.TransactionTime)); }
public async Task SetValue() { if (_selectedCap != "onoff") { throw new NotImplementedException("only onoff is supported"); } if (bool.TryParse(_selectedValue, out bool value)) { await _client.SetBooleanCapability(_selectedDeviceId, _selectedCap, value); } else { throw new ArgumentException("Value is not a boolean"); } }