Skip to content

Commit

Permalink
Merge pull request #93 from dvdgeisler/bugfix/update_off_on_condition
Browse files Browse the repository at this point in the history
#92 Support new sunset conditions
  • Loading branch information
TheMrBooyah authored Jul 6, 2023
2 parents de5097d + d5b70e7 commit 6fc27df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.time.LocalTime;

public class MotionSensorDeviceApi extends ControllerDeviceApi<
MotionSensorStateAttributes,
Expand Down Expand Up @@ -58,16 +57,17 @@ public Mono<MotionSensorDevice> disableSchedule(final MotionSensorDevice device)
return this.setConfigurationAttribute(device, attributes);
}

public Mono<MotionSensorDevice> setSchedule(final MotionSensorDevice device, final LocalTime from, final LocalTime to) {
public Mono<MotionSensorDevice> setSchedule(final MotionSensorDevice device, final String from, final int offSetFrom,
final String to, final int offSetTo) {
final MotionSensorConfigurationAttributes attributes;

attributes = new MotionSensorConfigurationAttributes();
attributes.sensorConfig = new MotionSensorConfig(
null,
null,
new MotionSensorSchedule(
new MotionSensorScheduleEntry(from),
new MotionSensorScheduleEntry(to)
new MotionSensorScheduleEntry(from, offSetFrom),
new MotionSensorScheduleEntry(to, offSetTo)
)
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package de.dvdgeisler.iot.dirigera.client.api.model.device.motionsensor;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalTime;

public class MotionSensorScheduleEntry {
@JsonFormat(pattern="HH:mm")
public LocalTime time;
public String time;
public int offset;

public MotionSensorScheduleEntry() {
}

public MotionSensorScheduleEntry(final LocalTime time) {
public MotionSensorScheduleEntry(String time, int offset) {
this.time = time;
this.offset = offset;
}
}

0 comments on commit 6fc27df

Please sign in to comment.