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.boschshc.internal.devices.bridge.dto;
15 import java.util.List;
17 import com.google.gson.annotations.SerializedName;
20 * Represents a single devices connected to the Bosch Smart Home Controller.
26 * "rootDeviceId":"64-da-a0-02-14-9b",
27 * "id":"hdm:HomeMaticIP:3014F711A00004953859F31B",
28 * "deviceServiceIds":["PowerMeter","PowerSwitch","PowerSwitchProgram","Routing"],
29 * "manufacturer":"BOSCH",
31 * "deviceModel":"PSM",
32 * "serial":"3014F711A00004953859F31B",
33 * "profile":"GENERIC",
34 * "name":"Coffee Machine",
35 * "status":"AVAILABLE",
39 * @author Stefan Kästle - Initial contribution
43 @SerializedName("@type")
46 public String rootDeviceId;
48 public List<String> deviceServiceIds;
49 public String manufacturer;
51 public String deviceModel;
53 public String profile;
56 public List<String> childDeviceIds;
58 public static Boolean isValid(Device obj) {
59 return obj != null && obj.id != null;
63 public String toString() {
65 "Type %s; RootDeviceId: %s; Id: %s; Device Service Ids: %s; Manufacturer: %s; Room Id: %s; Device Model: %s; Serial: %s; Profile: %s; Name: %s; Status: %s; Child Device Ids: %s ",
66 this.type, this.rootDeviceId, this.id,
67 this.deviceServiceIds != null ? String.join(", ", this.deviceServiceIds) : "null", this.manufacturer,
68 this.roomId, this.deviceModel, this.serial, this.profile, this.name, this.status,
69 this.childDeviceIds != null ? String.join(", ", this.childDeviceIds) : "null");