Typos, format and async consistency
This commit is contained in:
@ -1,76 +1,33 @@
|
||||
using System.Data;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using GoveeCSharpConnector.Objects;
|
||||
using GoveeCSharpConnector.Objects;
|
||||
|
||||
namespace GoveeCSharpConnector.Interfaces;
|
||||
|
||||
public interface IGoveeUdpService
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a Scan Command via Udp Multicast.
|
||||
/// </summary>
|
||||
/// <param name="timeout">Standard 250ms</param>
|
||||
/// <returns>List of GoveeUdpDevices</returns>
|
||||
Task<List<GoveeUdpDevice>> GetDevices(TimeSpan? timeout = null);
|
||||
public interface IGoveeUdpService {
|
||||
|
||||
/// <summary>
|
||||
/// Request the State of the Device
|
||||
/// </summary>
|
||||
/// <param name="deviceAddress">Ip Address of the Device</param>
|
||||
/// <param name="uniCastPort">Port of the Device. Standard 4003</param>
|
||||
/// <param name="timeout">Standard 250ms</param>
|
||||
/// <returns></returns>
|
||||
Task<GoveeUdpState> GetState(string deviceAddress, int uniCastPort = 4003, TimeSpan? timeout = null);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the On/Off State of the Device
|
||||
/// </summary>
|
||||
/// <param name="deviceAddress">Ip Address of the Device</param>
|
||||
/// <param name="on"></param>
|
||||
/// <param name="uniCastPort">Port of the Device. Standard 4003</param>
|
||||
/// <returns></returns>
|
||||
Task ToggleDevice(string deviceAddress, bool on, int uniCastPort = 4003);
|
||||
/// <summary>
|
||||
/// Sets the Brightness of the Device
|
||||
/// </summary>
|
||||
/// <param name="deviceAddress">Ip Address of the Device</param>
|
||||
/// <param name="brightness">In Percent 1-100</param>
|
||||
/// <param name="uniCastPort">Port of the Device. Standard 4003</param>
|
||||
/// <returns></returns>
|
||||
Task SetBrightness(string deviceAddress, int brightness, int uniCastPort = 4003);
|
||||
/// <summary>
|
||||
/// Sets the Color of the Device
|
||||
/// </summary>
|
||||
/// <param name="deviceAddress">Ip Address of the Device</param>
|
||||
/// <param name="color"></param>
|
||||
/// <param name="uniCastPort">Port of the Device. Standard 4003</param>
|
||||
/// <returns></returns>
|
||||
Task SetColor(string deviceAddress, RgbColor color, int uniCastPort = 4003);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ColorTemp of the Device
|
||||
/// </summary>
|
||||
/// <param name="deviceAddress">Ip Address of the Device</param>
|
||||
/// <param name="colorTempInKelvin"></param>
|
||||
/// <param name="uniCastPort">Port of the Device. Standard 4003</param>
|
||||
/// <returns></returns>
|
||||
Task SetColorTemp(string deviceAddress, int colorTempInKelvin, int uniCastPort = 4003);
|
||||
/// <summary>
|
||||
/// Starts the Udp Listener
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
void StartUdpListener();
|
||||
/// <summary>
|
||||
/// Returns the State of the Udp Listener
|
||||
/// </summary>
|
||||
/// <returns>True if Active</returns>
|
||||
bool IsListening();
|
||||
/// <summary>
|
||||
/// Stops the Udp Listener
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
void StopUdpListener();
|
||||
}
|
||||
Task StartUdpListenerAsync();
|
||||
Task<IList<GoveeUdpDevice>> GetDevicesAsync(TimeSpan? timeout = null);
|
||||
void ToggleDevice(string deviceAddress, bool on, int uniCastPort = 4003);
|
||||
void SetColor(string deviceAddress, RgbColor color, int uniCastPort = 4003);
|
||||
void SetBrightness(string deviceAddress, int brightness, int uniCastPort = 4003);
|
||||
void SetColorTemp(string deviceAddress, int colorTempInKelvin, int uniCastPort = 4003);
|
||||
Task<GoveeUdpState> GetStateAsync(string deviceAddress, int uniCastPort = 4003, TimeSpan? timeout = null);
|
||||
|
||||
// void StartUdpListener();
|
||||
// Task<ReadOnlyCollection<GoveeUdpDevice>> GetDevices(TimeSpan? timeout = null);
|
||||
// Task<GoveeUdpState> GetState(string deviceAddress, int uniCastPort = 4003, TimeSpan? timeout = null);
|
||||
|
||||
// public async Task<ReadOnlyCollection<GoveeUdpDevice>> GetDevices(TimeSpan? timeout = null) =>
|
||||
// new([.. (await GetDevicesAsync(timeout))]);
|
||||
|
||||
// public async Task<GoveeUdpState> GetState(string deviceAddress, int uniCastPort = 4003, TimeSpan? timeout = null) =>
|
||||
// await GetStateAsync(deviceAddress, uniCastPort, timeout);
|
||||
|
||||
// public async void StartUdpListener() =>
|
||||
// await StartUdpListenerAsync();
|
||||
|
||||
// private async void SetupUdpClientListener() =>
|
||||
// await SetupUdpClientListenerAsync();
|
||||
|
||||
}
|
Reference in New Issue
Block a user