]> git.basschouten.com Git - openhab-addons.git/blob
0327ef69b7d1ecad6ddf0ea3a51ca50e708bffb3
[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.boschshc.internal.devices.bridge.dto;
14
15 import org.eclipse.jdt.annotation.Nullable;
16 import org.openhab.binding.boschshc.internal.services.dto.BoschSHCServiceState;
17
18 import com.google.gson.JsonElement;
19
20 /**
21  * Represents a device status update as represented by the Smart Home
22  * Controller.
23  *
24  * @author Stefan Kästle - Initial contribution
25  * @author Christian Oeing - refactorings of e.g. server registration
26  */
27 public class DeviceServiceData extends BoschSHCServiceState {
28
29     /**
30      * Url path of the service the update came from.
31      */
32     public String path;
33
34     /**
35      * Name of service the update came from.
36      */
37     public String id;
38
39     /**
40      * Current state of device. Serialized as JSON.
41      */
42     public @Nullable JsonElement state;
43
44     /**
45      * Id of device the update is for.
46      */
47     public @Nullable String deviceId;
48
49     /**
50      * An optional object containing information about device faults.
51      * <p>
52      * Example: low battery warnings are stored as faults with category <code>WARNING</code>
53      */
54     public @Nullable Faults faults;
55
56     public DeviceServiceData() {
57         super("DeviceServiceData");
58     }
59
60     @Override
61     public String toString() {
62         return this.deviceId + " state: " + this.type;
63     }
64 }