2 * Copyright (c) 2010-2024 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.nibeuplink.internal.handler;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.nibeuplink.internal.command.GenericStatusUpdate;
17 import org.openhab.binding.nibeuplink.internal.command.NibeUplinkCommand;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
22 * Polling worker class. This is responsible for periodic polling of status values.
24 * @author Alexander Friese - initial contribution
27 public class UplinkPolling implements Runnable {
28 private final Logger logger = LoggerFactory.getLogger(getClass());
31 * Handler for delegation to callbacks.
33 private final NibeUplinkHandler handler;
38 * @param handler instance of the thing handler
40 public UplinkPolling(NibeUplinkHandler handler) {
41 this.handler = handler;
45 * Poll the Nibe Uplink webservice one time.
49 logger.debug("polling NibeUplink {}", handler.getConfiguration());
51 NibeUplinkCommand command = new GenericStatusUpdate(handler);
52 handler.getWebInterface().enqueueCommand(command);