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.hue.internal.dto;
15 import static java.util.stream.Collectors.joining;
17 import java.util.ArrayList;
20 * Collection of updates
22 * @author Q42 - Initial contribution
23 * @author Denis Dudnik - moved Jue library source code inside the smarthome Hue binding, minor code cleanup
24 * @author Samuel Leisering - Added support for sensor API
25 * @author Christoph Weitkamp - Added support for sensor API
27 public class ConfigUpdate {
29 public final ArrayList<Command> commands = new ArrayList<>();
31 public ConfigUpdate() {
35 public boolean isEmpty() {
36 return commands.isEmpty();
39 public String toJson() {
40 return commands.stream().map(c -> c.toJson()).collect(joining(",", "{", "}"));
44 * Returns the message delay recommended by Philips
45 * Regarding to this article: https://developers.meethue.com/documentation/hue-system-performance
47 public long getMessageDelay() {
48 return commands.size() * 40L;