]> git.basschouten.com Git - openhab-addons.git/blob
ebb0fe15e4da5e008c4edae1ab0be5b77df9fa2f
[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.ecobee.internal.function;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
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.
25  *
26  * @author John Cocula - Initial contribution
27  * @author Mark Hilbush - Adapt for OH2/3
28  */
29 @NonNullByDefault
30 public final class UpdateSensorFunction extends AbstractFunction {
31
32     public UpdateSensorFunction(@Nullable final String name, @Nullable final String deviceId,
33             @Nullable final String sensorId) {
34         super("updateSensor");
35
36         if (name == null || deviceId == null || sensorId == null) {
37             throw new IllegalArgumentException("name, deviceId and sensorId arguments are required.");
38         }
39         params.put("name", name);
40         params.put("deviceId", deviceId);
41         params.put("sensorId", sensorId);
42     }
43 }