]> git.basschouten.com Git - openhab-addons.git/blob
6484f2de58f4400cdbdfa63ffc3a35946e4f73ec
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.lifx.internal;
14
15 import java.util.concurrent.ScheduledExecutorService;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.lifx.internal.LifxProduct.Features;
19 import org.openhab.binding.lifx.internal.handler.LifxLightHandler;
20 import org.openhab.binding.lifx.internal.handler.LifxLightHandler.CurrentLightState;
21
22 /**
23  * The {@link LifxLightContext} shares the context of a light with {@link LifxLightHandler} helper objects.
24  *
25  * @author Wouter Born - Initial contribution
26  */
27 @NonNullByDefault
28 public class LifxLightContext {
29
30     private final String logId;
31     private final LifxLightConfig configuration;
32     private final CurrentLightState currentLightState;
33     private final LifxLightState pendingLightState;
34     private final Features features;
35     private final ScheduledExecutorService scheduler;
36
37     public LifxLightContext(String logId, Features features, LifxLightConfig configuration,
38             CurrentLightState currentLightState, LifxLightState pendingLightState, ScheduledExecutorService scheduler) {
39         this.logId = logId;
40         this.configuration = configuration;
41         this.features = features;
42         this.currentLightState = currentLightState;
43         this.pendingLightState = pendingLightState;
44         this.scheduler = scheduler;
45     }
46
47     public String getLogId() {
48         return logId;
49     }
50
51     public LifxLightConfig getConfiguration() {
52         return configuration;
53     }
54
55     public Features getFeatures() {
56         return features;
57     }
58
59     public CurrentLightState getCurrentLightState() {
60         return currentLightState;
61     }
62
63     public LifxLightState getPendingLightState() {
64         return pendingLightState;
65     }
66
67     public ScheduledExecutorService getScheduler() {
68         return scheduler;
69     }
70 }