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.io.imperihome.internal;
17 import org.openhab.core.id.InstanceUUID;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
22 * Configuration parser and container.
24 * @author Pepijn de Geus - Initial contribution
26 public class ImperiHomeConfig {
28 private final Logger logger = LoggerFactory.getLogger(ImperiHomeConfig.class);
30 private String systemId;
31 private String rootUrl;
33 public void update(Map<String, Object> config) {
34 Object cSystemId = config.get("system.id");
35 if (cSystemId == null || cSystemId.toString().isEmpty()) {
36 systemId = InstanceUUID.get();
38 systemId = cSystemId.toString();
41 Object rootUrlObj = config.get("openhab.rootUrl");
42 if (rootUrlObj != null) {
43 rootUrl = String.valueOf(rootUrlObj);
44 if (!rootUrl.endsWith("/")) {
49 logger.info("Configuration updated");
52 public String getSystemId() {
56 public String getRootUrl() {