예제 #1
0
 def getWirelessConfig(self):
     uri = self.__buildURI("/config/wireless.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Wireless state: {}. Mode: {}, essid: {} (ch:{}, {})."\
         .format(r['enable'], r['mode'], r['essid'], r['channel'], r['auth'])
         )
     return r
예제 #2
0
 def getSensorInfo(self):
     uri = self.__buildURI("/config/sensor.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Sensor: BR: {}, CN: {}, ST:{}, WB:{}. Color: {}.".format(
         r['brightness'], r['contrast'], r['saturation'], r['whitebalance'],
         r['color']))
     return r
예제 #3
0
 def getSdcard(self):
     uri = self.__buildURI("/config/sdcard.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("SD card status: {}.".format(r['status']))
     if r['status'] == "invalid":
         return False
     else:
         return True
예제 #4
0
 def checkAuth(self):
     uri = self.__buildURI("/users/verify.cgi")
     r = Get(uri, self.auth, parse="common")
     if r['group'] == "Administrator":
         l.info("Successfully authenticated.")
         return True
     else:
         l.error("Authentication failed.")
         return False
예제 #5
0
 def getMotionDetection(self):
     uri = self.__buildURI("/config/motion.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Motion detection enabled: {}. Sensitivity: {}.".format(r['enable'],
         r['sensitivity']))
     return r
예제 #6
0
 def getSpeaker(self):
     uri = self.__buildURI("/config/speaker.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Speaker enabled: {}. Volume: {}.".format(r['enable'],
         r['volume']))
     return r
예제 #7
0
 def getLED(self):
     uri = self.__buildURI("/config/led.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Device control LED is {}.".format(r['led']))
     return r
예제 #8
0
 def getICR(self):
     uri = self.__buildURI("/config/icr.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("ICR mode: {}. Light threshold is set to {}.".format(r['mode'],
         r['light_threshold']))
     return r
예제 #9
0
 def scanWifiAP(self):
     uri=self.__buildURI("config/wlansurvey.cgi")
     r = Get(uri, self.auth, parse=None)
     l.debug("Detected WIFI APs: {}".format(r))
     return r
예제 #10
0
 def getScreenshot(self):
     uri = self.__buildURI("/image/jpeg.cgi")
     jpeg = Get(uri, self.auth, parse="blob")
     l.info("Screenshot created. Size: {} bytes.".format(len(jpeg)))
     return jpeg
예제 #11
0
 def getName(self):
     uri = self.__buildURI("/config/camera_info.cgi")
     r = Get(uri, self.auth, parse="common")
     l.info("Connected to: {}, located at: {}"\
         .format(r['name'], r['location']))
     return r.values()