# Path: fluxghost/g.py
# USBDEVS = {}


from time import time
from fluxghost import g
import logging
import json
            self.POOL_TIME = 1.0

        def review_lan_devices(self):
            t = time()

            with self.server.discover_mutex:
                for uuid, device in self.server.discover_devices.items():
                    if t - device.last_update > 30:
                        # Dead devices
                        if uuid in self.lan_alive_devices:
                            self.lan_alive_devices.remove(uuid)
                            self.send_text(self.build_dead_response("lan",
                                                                    device))
                    else:
                        # Alive devices
                        self.lan_alive_devices.add(uuid)
                        self.send_text(self.build_response("lan", device))

        def review_usb_devices(self):
            rmlist = []
            for addr, uuid in self.usb_alive_addr.items():
                usbprotocol = g.USBDEVS.get(addr)
                if usbprotocol and usbprotocol.uuid == uuid:
                    pass
                else:
                    rmlist.append(addr)
                    self.send_text(self.build_dead_response("h2h", uuid=uuid))
            for addr in rmlist:
                self.usb_alive_addr.pop(addr)


# Path: fluxghost/g.py
# USBDEVS = {}


# Path: fluxghost/api/discover.py
from time import time
from fluxghost import g
import logging
import json

            self.POOL_TIME = 1.0

        def review_lan_devices(self):
            t = time()

            with self.server.discover_mutex:
                for uuid, device in self.server.discover_devices.items():
                    if t - device.last_update > 30:
                        # Dead devices
                        if uuid in self.lan_alive_devices:
                            self.lan_alive_devices.remove(uuid)
                            self.send_text(self.build_dead_response("lan",
                                                                    device))
                    else:
                        # Alive devices
                        self.lan_alive_devices.add(uuid)
                        self.send_text(self.build_response("lan", device))

        def review_usb_devices(self):
            rmlist = []
            for addr, uuid in self.usb_alive_addr.items():
                usbprotocol = g.USBDEVS.get(addr)
                if usbprotocol and usbprotocol.uuid == uuid:
                    pass
                else:
                    rmlist.append(addr)
                    self.send_text(self.build_dead_response("h2h", uuid=uuid))
            for addr in rmlist:
                self.usb_alive_addr.pop(addr)


            for addr, usbdevice in g.USBDEVS.items():