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.ecobee.internal.function;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * The update sensor function allows the caller to update the name of an ecobee3 remote sensor.
20 * Each ecobee3 remote sensor "enclosure" contains two distinct sensors types temperature
21 * and occupancy. Only one of the sensors is required in the request. Both of the sensors'
22 * names will be updated to ensure consistency as they are part of the same remote sensor
23 * enclosure. This also reflects accurately what happens on the Thermostat itself. Note: This
24 * function is restricted to the ecobee3 thermostat model only.
26 * @author John Cocula - Initial contribution
27 * @author Mark Hilbush - Adapt for OH2/3
30 public final class UpdateSensorFunction extends AbstractFunction {
32 public UpdateSensorFunction(@Nullable final String name, @Nullable final String deviceId,
33 @Nullable final String sensorId) {
34 super("updateSensor");
36 if (name == null || deviceId == null || sensorId == null) {
37 throw new IllegalArgumentException("name, deviceId and sensorId arguments are required.");
39 params.put("name", name);
40 params.put("deviceId", deviceId);
41 params.put("sensorId", sensorId);