Added UdpListener check
This commit is contained in:
@ -22,6 +22,7 @@ public class GoveeService : IGoveeService
|
||||
if (!onlyLan)
|
||||
return devices;
|
||||
|
||||
if (!_udpService.IsListening())
|
||||
_udpService.StartUdpListener();
|
||||
|
||||
var udpDevices = await _udpService.GetDevices();
|
||||
@ -37,6 +38,7 @@ public class GoveeService : IGoveeService
|
||||
{
|
||||
if (useUdp)
|
||||
{
|
||||
if (!_udpService.IsListening())
|
||||
_udpService.StartUdpListener();
|
||||
if (string.IsNullOrWhiteSpace(goveeDevice.Address)) throw new Exception("Device not available via Udp/Lan");
|
||||
var udpState = await _udpService.GetState(goveeDevice.Address);
|
||||
|
Reference in New Issue
Block a user