Bläddra i källkod

fixed devices status fix

Hal De 4 år sedan
förälder
incheckning
f6d39b0bab
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      app/app.py

+ 5 - 1
app/app.py

@@ -501,6 +501,9 @@ async def setQueueStates(user, device, state):
 async def getDeviceUser(device):
   return await amiDBGet('DEVICE', '{}/user'.format(device))
 
+async def getDeviceType(device):
+  return await amiDBGet('DEVICE', '{}/type'.format(device))
+
 async def getDeviceDial(device):
   return await amiDBGet('DEVICE', '{}/dial'.format(device))
 
@@ -570,7 +573,8 @@ async def rebindLostDevices():
   ast = await getGlobalVars()
   for device in app.cache['devices']:
     user = await getDeviceUser(device)
-    if (user != 'none') and (user in app.cache['ustates'].keys()):
+    deviceType = await getDeviceType(device)
+    if (deviceType != 'fixed') and (user != 'none') and (user in app.cache['ustates'].keys()):
       _device = await getUserDevice(user)
       if _device != device:
         app.logger.warning('Fixing bind user {} to device {}'.format(user, device))