2 * Copyright (c) 2010-2023 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.boschshc.internal.services;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.boschshc.internal.devices.bridge.BridgeHandler;
20 * Base class for Bosch Smart Home services containing what all services have in common.
22 * The services of the devices and their official APIs can be found
23 * <a href="https://apidocs.bosch-smarthome.com/local/">here</a>.
25 * @author Christian Oeing - Initial contribution
26 * @author David Pace - Service abstraction
29 public abstract class AbstractBoschSHCService {
34 private final String serviceName;
37 * Bridge to use for communication from/to the device
39 private @Nullable BridgeHandler bridgeHandler;
42 * Id of device the service belongs to
44 private @Nullable String deviceId;
46 protected AbstractBoschSHCService(String serviceName) {
47 this.serviceName = serviceName;
51 * Initializes the service
53 * @param bridgeHandler Bridge to use for communication from/to the device
54 * @param deviceId Id of device this service is for
56 public void initialize(BridgeHandler bridgeHandler, String deviceId) {
57 this.bridgeHandler = bridgeHandler;
58 this.deviceId = deviceId;
61 public String getServiceName() {
65 protected @Nullable BridgeHandler getBridgeHandler() {
69 protected @Nullable String getDeviceId() {