]> git.basschouten.com Git - openhab-addons.git/blob
7c14d62410d56dd3a0641fd8ca71aab9acbf72b6
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.hue.internal.api.dto.clip2;
14
15 import java.time.Instant;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 import com.google.gson.annotations.SerializedName;
20
21 /**
22  * DTO for CLIP 2 light level sensor report.
23  *
24  * @author Jacob Laursen - Initial contribution
25  */
26 @NonNullByDefault
27 public class LightLevelReport {
28     private @NonNullByDefault({}) Instant changed;
29     private @SerializedName("light_level") int lightLevel;
30
31     /**
32      * @return last time the value of this property is changed.
33      */
34     public Instant getLastChanged() {
35         return changed;
36     }
37
38     /**
39      * Light level in 10000*log10(lux) +1 measured by sensor.
40      * Logarithmic scale used because the human eye adjusts to light levels and small changes at low lux levels
41      * are more noticeable than at high lux levels. This allows use of linear scale configuration sliders.
42      *
43      * @return light level in 10000*log10(lux) +1 measured by sensor
44      */
45     public int getLightLevel() {
46         return lightLevel;
47     }
48 }