Explorar o código

Increased sonoff scanner time to 30s

TC pushbot 5 %!s(int64=2) %!d(string=hai) anos
pai
achega
5794937b25
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      mod/iot/sonoff_s2x/sonoff_s2x.go

+ 2 - 2
mod/iot/sonoff_s2x/sonoff_s2x.go

@@ -25,7 +25,7 @@ type Handler struct {
 	lastScanTime int64
 }
 
-//Create a new Sonoff S2X Protocol Handler
+// Create a new Sonoff S2X Protocol Handler
 func NewProtocolHandler(scanner *mdns.MDNSHost) *Handler {
 	//Create a new MDNS Host
 	return &Handler{
@@ -41,7 +41,7 @@ func (h *Handler) Start() error {
 
 func (h *Handler) Scan() ([]*iot.Device, error) {
 	results := []*iot.Device{}
-	scannedDevices := h.scanner.Scan(10, "")
+	scannedDevices := h.scanner.Scan(30, "")
 	for _, dev := range scannedDevices {
 		if dev.Port == 80 {
 			if len(dev.IPv4) == 0 {