Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Schedule can not work ,but the callback was success #43

Open
YzjAndroid opened this issue Nov 28, 2017 · 0 comments
Open

Schedule can not work ,but the callback was success #43

YzjAndroid opened this issue Nov 28, 2017 · 0 comments

Comments

@YzjAndroid
Copy link

public static void addGroupTimer(Bridge bridge, LightState lightState, String scheduleName,
                                 String scheduleDesc, TimerScheduleBean timerScheduleBean,
                                 LightPoint lightPoint, final IStateCallBack iStateCallBack) {
    Schedule schedule = new Schedule();
    schedule.setAutoDelete(true);
    schedule.setName(scheduleName);
    schedule.setDescription(scheduleDesc);
    schedule.setStatus(ScheduleStatus.ENABLED);

    ClipActionBuilder clipActionBuilder = new ClipActionBuilder();

// clipActionBuilder.setGroupLightState(groupId, lightState);
clipActionBuilder.updateDeviceState(lightPoint,lightState);
schedule.setClipAction(clipActionBuilder.buildSingle(bridge.getBridgeConfiguration().getVersion()));
// Triggers 1-1-2035 @ 10:05 A.M.
TimePatternBuilder timePatternBuilder = new TimePatternBuilder();
// day month year hour min sec
timePatternBuilder.startAtDate(timerScheduleBean.day, timerScheduleBean.month, timerScheduleBean.year,
timerScheduleBean.hour, timerScheduleBean.minute, timerScheduleBean.second);
schedule.setLocalTime(timePatternBuilder.build());
bridge.updateResource(schedule, BridgeConnectionType.LOCAL, new MyBridgeResponseCallback(iStateCallBack));

}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant