예제 #1
0
 def get_status(pairedDeviceId, language=AppInfo.DEFAULT_API_LANGUAGE):
     return SharedMethod.call(kbxMethodAppId=SharedMethod.get_system_id(),
                              kbxMethodName="get_status",
                              kbxModuleName="device_manager.horn_controller",
                              pyapi=SharedMethod.get_pyapi(),
                              pairedDeviceId=pairedDeviceId,
                              **{AppInfo.REQUEST_KEY_LANGUAGE:language})
예제 #2
0
 def get_status(pairedDeviceId, language=AppInfo.DEFAULT_API_LANGUAGE):
     return SharedMethod.call(
         kbxMethodAppId=SharedMethod.get_system_id(),
         kbxMethodName="get_status",
         kbxModuleName="device_manager.horn_controller",
         pyapi=SharedMethod.get_pyapi(),
         pairedDeviceId=pairedDeviceId,
         **{AppInfo.REQUEST_KEY_LANGUAGE: language})
예제 #3
0
 def set_off(pairedDeviceId, language=AppInfo.DEFAULT_API_LANGUAGE):
     '''
     Turn off switch.
     pairedDeviceId:Number :- Paired Device ID return from DeviceManagerService.get_paired_device_list
     transitionTime:Number :- Optional. the duration of the transition from the light's current state to the new state.
     '''
     return SharedMethod.call(kbxMethodAppId=SharedMethod.get_system_id(),
                              kbxMethodName="set_off",
                              kbxModuleName="device_manager.horn_controller",
                              pyapi=SharedMethod.get_pyapi(),
                              pairedDeviceId=pairedDeviceId,
                              **{AppInfo.REQUEST_KEY_LANGUAGE:language})
예제 #4
0
 def set_off(pairedDeviceId, language=AppInfo.DEFAULT_API_LANGUAGE):
     '''
     Turn off switch.
     pairedDeviceId:Number :- Paired Device ID return from DeviceManagerService.get_paired_device_list
     transitionTime:Number :- Optional. the duration of the transition from the light's current state to the new state.
     '''
     return SharedMethod.call(
         kbxMethodAppId=SharedMethod.get_system_id(),
         kbxMethodName="set_off",
         kbxModuleName="device_manager.horn_controller",
         pyapi=SharedMethod.get_pyapi(),
         pairedDeviceId=pairedDeviceId,
         **{AppInfo.REQUEST_KEY_LANGUAGE: language})
예제 #5
0
 def execution_func(sceneThreadEvent, kbxMethodId, seri, **kwargs):
     try:
         if kbxMethodId == -291:
             # Delay Timer
             delayInSec = kwargs["delayInSec"]
             sceneThreadEvent.wait(delayInSec)
             seri["seriError"] = None
         else:
             # Execute method
             result = SharedMethod.call(**kwargs)
             seri["seriError"] = str(result)
             
         seri["seriStatus"] = "ok"
     
     except Exception as e:
         seri["seriStatus"] = "error"
         seri["seriError"] = str(e)
         Logger.log_debug("Execution failed, method:", kwargs["kbxMethodName"])
     
     finally:
         sceneThreadEvent.set()
예제 #6
0
        def execution_func(sceneThreadEvent, kbxMethodId, seri, **kwargs):
            try:
                if kbxMethodId == -291:
                    # Delay Timer
                    delayInSec = kwargs["delayInSec"]
                    sceneThreadEvent.wait(delayInSec)
                    seri["seriError"] = None
                else:
                    # Execute method
                    result = SharedMethod.call(**kwargs)
                    seri["seriError"] = str(result)

                seri["seriStatus"] = "ok"

            except Exception as e:
                seri["seriStatus"] = "error"
                seri["seriError"] = str(e)
                Logger.log_debug("Execution failed, method:",
                                 kwargs["kbxMethodName"])

            finally:
                sceneThreadEvent.set()