Infrared Remote Control SDK Use
1. Overview
This article mainly introduces how to use the infrared SDK to make Api calls.
2. Preconditions
- Confirm completion Preparation
- Confirm the completion of Environment Build
- Complete Infrared Remote Control SDK Integration
3. Use
For devices with infrared functions, other SDKs will automatically jump to the infrared remote control SDK through ARouter without third-party processing.
3.1 Jump to the control page of the infrared virtual Sub-Device
If you need to jump directly to the infrared virtual Sub-Device on your App list page, you can adjust the following method:
LumiIrManager.getInstance().routerApi.jumpIrCtrlPage(
context,
"irDeviceModel",
"irDeviceId",
"irDeviceName",
acStatus
)
Parameter Description
Field | Type of data | Describe | Access channel |
---|---|---|---|
context | Context | Context | / |
irDeviceModel | String | Model Values for IR Virtual Sub-Device | Interface acquisition |
irDeviceId | String | The device id of the infrared virtual Sub-Device | Interface acquisition |
irDeviceName | String | The device name of the infrared virtual Sub-Device, empty is allowed | Interface acquisition |
acStatus | String | Air conditioner status, if the model value is virtual.ir.ac, you need to pass this parameter; value: 1 stateless air conditioner 2 stateful air conditioner,; | Interface acquisition |
3.2 Event listener
When the user clicks some buttons or meets other conditions during the page operation, the event callback can be obtained through the event listener. For example, click a button to jump to a page in the host App, or a third-party custom event.
LumiIrManager.getInstance().actionApi.addActionListener(object : OnLMIRActionListener {
override fun onRouterActionEvent(context: Context?, actionName: String?, params: String?) {
//TO DO Something
}
})
Event list:
Event | Description | Describe |
---|---|---|
ACTION_START_OWN_GATEWAY | Hub function | After the user clicks on the Hub, a third party needs to process it by itself. |