Example #1
0
File: jinja.py Project: ygl-rg/AIRi
 def getCamera(address):
     out = {}
     try:
         out.update(CameraFactory.getCamera(address))
     except UnknownDevice, err:
         out["address"] = address
         out["name"] = resolve_name(address)
         out["new_device"] = True
         out["types"] = CameraFactory.getTypes()
Example #2
0
 def getCamera(address):
     out = {}
     try:
         out.update(CameraFactory.getCamera(address))
     except UnknownDevice, err:
         out["address"] = address
         out["name"] = resolve_name(address)
         out["new_device"] = True
         out["types"] = CameraFactory.getTypes()
Example #3
0
    def getCamera(klass, address, silent=False):
        out = settings.getCamera(address)
        if not out:
            if not silent:
                raise UnknownDevice(address)
            return None

        out["status"] = klass.isConnected(address)
        if klass.isConnected(address):
            out["name"] = twisted_bluetooth.resolve_name(address)
            settings.setCamera(out)
            settings.save()
        out["capabilities"] = TYPES[out["type"]]["class"].Capabilities
        return out
Example #4
0
    def getCamera(klass, address, silent=False):
        out = settings.getCamera(address)
        if not out:
            if not silent:
                raise UnknownDevice(address)
            return None

        out["status"] = klass.isConnected(address)
        if klass.isConnected(address):
            out["name"] = twisted_bluetooth.resolve_name(address)
            settings.setCamera(out)
            settings.save()
        out["capabilities"] = TYPES[out["type"]]["class"].Capabilities
        return out