]> git.basschouten.com Git - openhab-addons.git/blob
e7e541ccd0f42553892ad1ba1c5c42f5c474e231
[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.souliss.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.thing.Bridge;
18
19 /**
20  * @author Tonino Fazio - Initial contribution
21  * @author Luca Calcaterra - Refactor for OH3
22  */
23
24 @NonNullByDefault
25 public class SoulissGatewayJobSubscription implements Runnable {
26
27     private @Nullable SoulissGatewayHandler gwHandler;
28
29     public SoulissGatewayJobSubscription(Bridge bridge) {
30         this.gwHandler = (SoulissGatewayHandler) bridge.getHandler();
31     }
32
33     @Override
34     public void run() {
35         sendSubscription();
36     }
37
38     private void sendSubscription() {
39         SoulissGatewayHandler localGwHandler = this.gwHandler;
40         if (localGwHandler != null) {
41             localGwHandler.sendSubscription();
42         }
43     }
44 }