-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Integrated the "feature" support in to new controller groups. * Implemented controller schedules (both read and write) implementation Various other fixes * Addressed many warning/errors and cleanup * Added support for units on temperatures, power, etc. * Added intelliflo gpm fixed spelling error added intelliflo status * Added direct support for motor (when controller is not present or in service mode) * Removed apache.commons dependency * Removed gnu.io dependency. Reworked some of the state changes in the basebridgehandler. * Added auto discovery Finished schedule implementation Various other fixes Addressed many warning/errors More cleanup Updated README with changes. Added support for UOM Added intelliflo gpm fixed spelling error added intelliflo status Removed apache.commons import Removed gnu.io dependency. Reworked some of the state changes in the basebridgehandler. Added auto discovery
- Loading branch information
Showing
29 changed files
with
3,271 additions
and
1,136 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
....openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/MapUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright (c) 2010-2020 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.pentair.internal; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link PentairBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Jeff James - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public final class MapUtils { | ||
public static <K, V> Map<K, V> mapOf(Object... keyValues) { | ||
Map<K, V> map = new HashMap<K, V>(keyValues.length / 2); | ||
|
||
for (int index = 0; index < keyValues.length / 2; index++) { | ||
map.put((K) keyValues[index * 2], (V) keyValues[index * 2 + 1]); | ||
} | ||
|
||
return map; | ||
} | ||
|
||
public static <A, B> Map<B, A> invertMap(Map<A, B> map) { | ||
Map<B, A> reverseMap = new HashMap<>(); | ||
for (Map.Entry<A, B> entry : map.entrySet()) { | ||
reverseMap.put(entry.getValue(), entry.getKey()); | ||
} | ||
return reverseMap; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.