2 * Copyright (c) 2010-2020 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.openuv.internal.json;
15 import java.math.BigInteger;
17 import org.eclipse.jdt.annotation.Nullable;
18 import org.openhab.core.library.types.QuantityType;
19 import org.openhab.core.library.unit.SmartHomeUnits;
20 import org.openhab.core.types.State;
21 import org.openhab.core.types.UnDefType;
24 * Wrapper type around values reported by OpenUV safe exposure time.
26 * @author Gaƫl L'hopital - Initial contribution
28 public class SafeExposureTime {
29 public @Nullable BigInteger st1;
30 public @Nullable BigInteger st2;
31 public @Nullable BigInteger st3;
32 public @Nullable BigInteger st4;
33 public @Nullable BigInteger st5;
34 public @Nullable BigInteger st6;
36 public State getSafeExposure(int index) {
60 return (result != null) ? new QuantityType<>(result, SmartHomeUnits.MINUTE) : UnDefType.NULL;