# FB-2 - turns lights on and off if (objectServerID == "FB-2"): #check for validate request # validate allows RasPiConnect to verify this object is here if (validate == "YES"): outgoingXMLData += Validate.buildValidateResponse("YES") outgoingXMLData += BuildResponse.buildFooter() return outgoingXMLData # not validate request, so execute responseData = "XXX" if (objectName is None): objectName = "XXX" lowername = objectName.lower() if (lowername == "all lights on"): status = sendCommandToBeaconAirAndWait("ALLLIGHTSON") responseData = "all lights off" responseData = responseData.title() elif (lowername == "all lights off"): status = sendCommandToBeaconAirAndWait("ALLLIGHTSOFF") responseData = "all lights on" responseData = responseData.title() # defaults to on else: status = sendCommandToBeaconAirAndWait("ALLLIGHTSON") lowername = "all lights off" responseData = lowername.title() outgoingXMLData += BuildResponse.buildResponse(responseData) outgoingXMLData += BuildResponse.buildFooter() return outgoingXMLData