2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.sensibo.internal.model;
15 import java.time.LocalTime;
16 import java.time.ZonedDateTime;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.sensibo.internal.dto.poddetails.ScheduleDTO;
23 * The {@link SensiboSky} represents a Sensibo Sky schedule
25 * @author Arne Seime - Initial contribution
28 public class Schedule {
29 private final LocalTime targetTimeLocal;
30 private final String[] recurringDays;
31 private final AcState acState;
32 private final boolean enabled;
33 private @Nullable ZonedDateTime nextTime;
35 public Schedule(ScheduleDTO dto) {
36 this.enabled = dto.enabled;
38 this.nextTime = ZonedDateTime.parse(nextTime + "Z"); // API field seems to be in Zulu
40 this.targetTimeLocal = LocalTime.parse(dto.targetTimeLocal);
41 this.recurringDays = dto.recurringDays;
42 this.acState = new AcState(dto.acState);
45 public LocalTime getTargetTimeLocal() {
46 return targetTimeLocal;
49 public @Nullable ZonedDateTime getNextTime() {
53 public String[] getRecurringDays() {
57 public AcState getAcState() {
61 public boolean isEnabled() {