public static async Task <GpioPin> GetGPIODevice(GPIODevices gpioDevice) { switch (gpioDevice) { case GPIODevices.FanRelay: return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.FanRelay))); case GPIODevices.HumidityRelay: return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.HumidityRelay))); case GPIODevices.LightRelay: return(await GPIOSlave.Initialize(Convert.ToInt32(GPIODevices.LightRelay))); default: throw new ArgumentOutOfRangeException(nameof(gpioDevice), gpioDevice, null); } }
public PowerRelay(GPIODevices gpioDevice) { _deviceType = gpioDevice; }