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.meater.internal.dto;
15 import java.time.Instant;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.SerializedName;
24 * The {@link MeaterProbeDTO} class defines the DTO for the Meater probe.
26 * @author Jan Gustafsson - Initial contribution
29 public class MeaterProbeDTO {
31 public String status = "";
32 public long statusCode;
33 public Data data = new Data();
34 public Meta meta = new Meta();
36 public Data getData() {
43 public List<Device> devices;
45 public @Nullable List<Device> getDevices() {
49 public @Nullable Device getDevice(String id) {
50 List<Device> localDevices = devices;
51 if (localDevices != null) {
52 for (Device meaterProbe : localDevices) {
53 if (id.equals(meaterProbe.id)) {
66 public String id = "";
67 public Temperature temperature = new Temperature();
68 public @Nullable Cook cook = new Cook();
69 @SerializedName("updated_at")
70 private long lastConnection;
72 public @Nullable Instant getLastConnection() {
73 if (lastConnection > 0) {
74 return Instant.ofEpochSecond(lastConnection);
81 public String id = "";
82 public String name = "";
83 public String state = "";
84 public TemperatureCook temperature = new TemperatureCook();
85 public Time time = new Time();
88 public class TemperatureCook {
93 public class Temperature {
94 public double internal;
95 public double ambient;
100 public long remaining;