Pause and resume devices (ref #215)

This commit is contained in:
Jakob Borg
2015-08-23 21:56:10 +02:00
parent 1e447741ee
commit 944d9c84a0
10 changed files with 154 additions and 23 deletions

View File

@@ -158,6 +158,10 @@ next:
l.Infof("Connected to already connected device (%s)", remoteID)
c.Conn.Close()
continue
} else if s.model.IsPaused(remoteID) {
l.Infof("Connection from paused device (%s)", remoteID)
c.Conn.Close()
continue
}
for deviceID, deviceCfg := range s.cfg.Devices() {
@@ -235,6 +239,10 @@ func (s *connectionSvc) connect() {
continue
}
if s.model.IsPaused(deviceID) {
continue
}
connected := s.model.ConnectedTo(deviceID)
s.mut.RLock()