-
public interface IThingDevice
Provides device related operations, like device control, status change monitoring, rename, firmware upgrade, remove, factory reset and so on.
-
-
Method Summary
Modifier and Type Method Description abstract void
removeDevice(IResultCallback callback)
Remove the device from the list of user devices. abstract void
renameDevice(String name, IResultCallback callback)
Rename the device abstract void
publishDps(String dps, ThingDevicePublishModeEnum publishModeEnum, IResultCallback callback)
Send the command to the deviceThe successful issuing of a command does not mean that the device is successfully operated,but only means that the command has been successfully sent. abstract void
publishDps(String dps, IResultCallback callback)
Send the command to the device by auto mode abstract void
publishCommands(Map<String, Object> commands, IResultCallback callback)
Send the standard data points code command to the device by auto mode abstract void
infraredPublishDps(String subDevId, String actionDps, String reportDps, IResultCallback callback)
The infrared device sends commands to the device abstract boolean
isMqttConnect()
Whether the MQTT is connected. abstract void
registerDeviceListener(IDeviceListener listener)
Registration the standard instruction device status change listener!!! abstract void
registerDevListener(IDevListener listener)
Register the device status change listenerThe device related information (dp data, device name, device online status and device removal),which will be synchronized here in real time. abstract void
unRegisterDevListener()
Unregister the device status change listener abstract void
getDp(String dpId, IResultCallback callback)
Query the latest data of the dp from the device;Those data will be called back from the registerDevListeneronDpUpdate. abstract void
getDpList(List<String> dpId, IResultCallback callback)
Query the data point list by data point id from the device; abstract void
resetFactory(IResultCallback callback)
Reset the device and restore to the factory settings;The device-related data will be cleared;And the device will re-enter the network to be distributed state (smart config mode); abstract void
getDeviceProperty(IPropertyCallback<Map> callback)
Get the device property abstract void
saveDeviceProperty(String code, String value, IResultCallback callback)
Save the device property abstract void
getDataPointStat(DataPointTypeEnum type, long startTime, int number, String dpId, IGetDataPointStatCallback callback)
Get the device's history data point. abstract void
updateIcon(File iconFile, IResultCallback callback)
Update the device's icon abstract void
queryData(String data, IResultCallback callback)
Query data abstract void
onDestroy()
Recycle and release the resources abstract void
requestWifiSignal(WifiSignalListener listener)
Query the signal strength of the current device's Wi-Fi abstract void
getInitiativeQueryDpsInfoWithDpsArray(List<Integer> dps, IResultCallback callback)
Query the device's power consumption abstract void
registerWarnMessageListener(IWarningMsgListener iWarningMsgListener)
Register warn message listener abstract void
registerUpgradeStatusListener(IThingDeviceUpgradeStatusCallback callback)
Register Upgrade status listener abstract void
publishDps(String dps, String orders, IResultCallback callback)
Distributed according to the specified channel sequence abstract void
getOfflineReminderSupportStatus(String hdId, IThingResultCallback<IsSupportOffLineBean> callback)
abstract void
getOfflineReminderStatus(String devId, IThingResultCallback<Boolean> callback)
Query the setting status of device offline reminders abstract void
setOfflineReminderStatus(String devId, boolean isWarn, IResultCallback callback)
Set device offline reminder function abstract void
publishThingMessageWithType(ThingSmartThingMessageType thingMessageType, Object command, IResultCallback callback)
Send the data command to the thing_link device by mqtt abstract void
registerThingLinkMessageListener(IThingLinkDeviceListener listener)
register thinglink device message listener abstract void
unRegisterThingLinkMessageListener()
unRegister thinglink device message listener abstract void
recordPublishDpEvent(DPEventSrcEnum dpEventSrcEnum, String dps)
-
-
Method Detail
-
removeDevice
abstract void removeDevice(IResultCallback callback)
Remove the device from the list of user devices.
- Parameters:
callback
- Callback IResultCallback
-
renameDevice
abstract void renameDevice(String name, IResultCallback callback)
Rename the device
- Parameters:
name
- The name of the replacementcallback
- Callback IResultCallback
-
publishDps
abstract void publishDps(String dps, ThingDevicePublishModeEnum publishModeEnum, IResultCallback callback)
Send the command to the device
The successful issuing of a command does not mean that the device is successfully operated,but only means that the command has been successfully sent.
If the operation succeeds, the data point information will be reported,and returned through the onDpUpdate interface.
The command string is converted to jsonString in the format of Map.
The command can send multiple dp data at one time.
- Parameters:
dps
- Data pointspublishModeEnum
- Publish mode ThingDevicePublishModeEnumcallback
- Callback IResultCallback
-
publishDps
abstract void publishDps(String dps, IResultCallback callback)
Send the command to the device by auto mode
- Parameters:
dps
- Data pointscallback
- Callback IResultCallback
-
publishCommands
abstract void publishCommands(Map<String, Object> commands, IResultCallback callback)
Send the standard data points code command to the device by auto mode
- Parameters:
commands
- Standard data points codecallback
- Callback IResultCallback
-
infraredPublishDps
abstract void infraredPublishDps(String subDevId, String actionDps, String reportDps, IResultCallback callback)
The infrared device sends commands to the device
-
isMqttConnect
@Deprecated() abstract boolean isMqttConnect()
Whether the MQTT is connected.
Not recommended, it is recommended to use another interface isServerConnect, such as
{@code ThingHomeSdk.getServerInstance().isServerConnect()}
-
registerDeviceListener
abstract void registerDeviceListener(IDeviceListener listener)
Registration the standard instruction device status change listener!!! Not opened yet !!!
- Parameters:
listener
- The listener IDeviceListener
-
registerDevListener
abstract void registerDevListener(IDevListener listener)
Register the device status change listener
The device related information (dp data, device name, device online status and device removal),which will be synchronized here in real time.
- Parameters:
listener
- The listener IDevListener
-
unRegisterDevListener
abstract void unRegisterDevListener()
Unregister the device status change listener
-
getDp
abstract void getDp(String dpId, IResultCallback callback)
Query the latest data of the dp from the device;
Those data will be called back from the registerDevListeneronDpUpdate.
- Parameters:
dpId
- Data point idcallback
- Callback IResultCallback
-
getDpList
abstract void getDpList(List<String> dpId, IResultCallback callback)
Query the data point list by data point id from the device;
- Parameters:
dpId
- Data point idcallback
- Callback IResultCallback
-
resetFactory
abstract void resetFactory(IResultCallback callback)
Reset the device and restore to the factory settings;The device-related data will be cleared;And the device will re-enter the network to be distributed state (smart config mode);
- Parameters:
callback
- Callback IResultCallback
-
getDeviceProperty
abstract void getDeviceProperty(IPropertyCallback<Map> callback)
Get the device property
- Parameters:
callback
- Callback IPropertyCallback
-
saveDeviceProperty
abstract void saveDeviceProperty(String code, String value, IResultCallback callback)
Save the device property
- Parameters:
code
- Data point's keyvalue
- Data point's valuecallback
- Callback IResultCallback
-
getDataPointStat
@Deprecated() abstract void getDataPointStat(DataPointTypeEnum type, long startTime, int number, String dpId, IGetDataPointStatCallback callback)
Get the device's history data point.
Replace by https://thinginc.github.io/thingsmart_home_android_sdk_doc/zh-hans/resource/Device_Get_Dps_History.html
- Parameters:
type
- Data point type DataPointTypeEnumstartTime
- StartTimenumber
- Data point count, valid values: (1~50)dpId
- Data point idcallback
- Callback IGetDataPointStatCallback
-
updateIcon
abstract void updateIcon(File iconFile, IResultCallback callback)
Update the device's icon
- Parameters:
iconFile
- The icon filecallback
- Callback IResultCallback
-
queryData
abstract void queryData(String data, IResultCallback callback)
Query data
- Parameters:
data
- Data pointcallback
- Callback IResultCallback
-
onDestroy
abstract void onDestroy()
Recycle and release the resources
-
requestWifiSignal
abstract void requestWifiSignal(WifiSignalListener listener)
Query the signal strength of the current device's Wi-Fi
- Parameters:
listener
- Listener WifiSignalListener
-
getInitiativeQueryDpsInfoWithDpsArray
abstract void getInitiativeQueryDpsInfoWithDpsArray(List<Integer> dps, IResultCallback callback)
Query the device's power consumption
- Parameters:
dps
- Data point id listcallback
- Callback IResultCallback
-
registerWarnMessageListener
abstract void registerWarnMessageListener(IWarningMsgListener iWarningMsgListener)
Register warn message listener
- Parameters:
iWarningMsgListener
- Listener IWarningMsgListener
-
registerUpgradeStatusListener
abstract void registerUpgradeStatusListener(IThingDeviceUpgradeStatusCallback callback)
Register Upgrade status listener
- Parameters:
callback
- Callback IThingDeviceUpgradeStatusCallback
-
publishDps
abstract void publishDps(String dps, String orders, IResultCallback callback)
Distributed according to the specified channel sequence
-
getOfflineReminderSupportStatus
abstract void getOfflineReminderSupportStatus(String hdId, IThingResultCallback<IsSupportOffLineBean> callback)
-
getOfflineReminderStatus
abstract void getOfflineReminderStatus(String devId, IThingResultCallback<Boolean> callback)
Query the setting status of device offline reminders
-
setOfflineReminderStatus
abstract void setOfflineReminderStatus(String devId, boolean isWarn, IResultCallback callback)
Set device offline reminder function
-
publishThingMessageWithType
abstract void publishThingMessageWithType(ThingSmartThingMessageType thingMessageType, Object command, IResultCallback callback)
Send the data command to the thing_link device by mqtt
- Parameters:
thingMessageType
- ThingSmartThingMessageTypecommand
- Standard data points code eg {"code":"1424", xx:xxx} json datacallback
- Callback IResultCallback
-
registerThingLinkMessageListener
abstract void registerThingLinkMessageListener(IThingLinkDeviceListener listener)
register thinglink device message listener
-
unRegisterThingLinkMessageListener
abstract void unRegisterThingLinkMessageListener()
unRegister thinglink device message listener
-
recordPublishDpEvent
abstract void recordPublishDpEvent(DPEventSrcEnum dpEventSrcEnum, String dps)
-
-
-
-