Last Updated on : 2023-05-22 06:38:24
Returns the status of the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
void getPushStatus(ITuyaResultCallback<PushStatusBean> callback);
Parameters
Parameter | Description |
---|---|
callback | The success or failure callback. |
Example
TuyaHomeSdk.getPushInstance().getPushStatus(new ITuyaResultCallback<PushStatusBean>() {
@Override
public void onSuccess(PushStatusBean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
Enables or disables the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
void setPushStatus(boolean isOpen, ITuyaDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
isOpen | Specifies whether to enable this feature. |
callback | The success or failure callback. |
Example
TuyaHomeSdk.getPushInstance().setPushStatus(open, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getPushStatusByType(PushType type, ITuyaDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
type | The type of message. Valid values:
|
callback | The success or failure callback. |
Example
TuyaHomeSdk.getPushInstance().getPushStatusByType(type, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void setPushStatusByType(PushType type, isOpen, ITuyaDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
type | The type of message. Valid values:
|
isOpen | Specifies whether to enable this feature. |
callback | The success or failure callback. |
Example
TuyaHomeSdk.getPushInstance().setPushStatusByType(pushType, checked, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDNDList(ITuyaDataCallback<ArrayList<DeviceAlarmNotDisturbVO>> listener);
Parameters
Parameter | Description |
---|---|
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().getDNDList(new ITuyaDataCallback<DeviceAlarmNotDisturbVO>() {
@Override
public void onSuccess(DeviceAlarmNotDisturbVO result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDNDDeviceList(ITuyaDataCallback<ArrayList<NodisturbDevicesBean>> listener);
Parameters
Parameter | Description |
---|---|
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().getDNDDeviceList(new ITuyaDataCallback<NodisturbDevicesBean>() {
@Override
public void onSuccess(NodisturbDevicesBean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDeviceDNDSetting(ITuyaDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
listener | The success callback. The current Do Not Disturb (DND) status is returned. Valid values:
|
Example
TuyaHomeSdk.getMessageInstance().getDeviceDNDSetting(new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void setDeviceDNDSetting(boolean open, ITuyaDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
open | Specifies whether to enable this feature. |
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().setDeviceDNDSetting(open, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void addDNDWithStartTime(String startTime, String endTime, String devIds, String loops, ITuyaDataCallback<Long> listener);
Parameters
Parameter | Description |
---|---|
startTime | The start time of the DND period. |
endTime | The end time of the DND period. |
devIds | The list of device IDs. |
loops | The weekly schedule. |
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().addDNDWithStartTime(startTime, endTime, devIds, loops, new ITuyaDataCallback<Long>() {
@Override
public void onSuccess(Long result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void removeDNDWithTimerId(long id, ITuyaDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
id | The ID of the DND period to be removed. |
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().removeDNDWithTimerId(id, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void modifyDNDWithTimerId(long nodisturbAlarmId, String mStartTime, String mEndTime, String devIds, String loops, ITuyaDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
nodisturbAlarmId | The ID of the DND period to be modified. |
mStartTime | The start time of the DND period. |
mEndTime | The end time of the DND period. |
loops | The weekly schedule. |
listener | The success or failure callback. |
Example
TuyaHomeSdk.getMessageInstance().modifyDNDWithTimerId(nodisturbAlarmId, mStartTime, mEndTime, devIds, loops, new ITuyaDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback