forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[danfossairunit] Fix network reliability issues and setting of all ch…
…annel values to zero (openhab#11172) * Fix Potential null pointer accesses * Added constants for TCP port and poll interval in seconds. * Extract interface from DanfossAirUnitCommunicationController. * Remove unused constants which seems to be left-overs from skeleton. * Added constant for discovery timeout value for readability. * Created handler subfolder for DanfossAirUnitHandler (like discovery) for consistency with other bindings. * Handle lost connection gracefully without updating all channels to zero. * Fix infinitly blocking network calls preventing proper error handling. * Fix thing status being reset to ONLINE after failing to update all channels. * Fix error handling when receiving invalid manual fan step. Fixes openhab#11167 Fixes openhab#11188 Signed-off-by: Jacob Laursen <[email protected]> Signed-off-by: Dave J Schoepel <[email protected]>
- Loading branch information
Showing
8 changed files
with
299 additions
and
97 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...it/src/main/java/org/openhab/binding/danfossairunit/internal/CommunicationController.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,33 @@ | ||
/** | ||
* Copyright (c) 2010-2021 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.danfossairunit.internal; | ||
|
||
import java.io.IOException; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* This interface defines a communication controller that can be used to send requests to the Danfoss Air Unit. | ||
* | ||
* @author Jacob Laursen - Refactoring, bugfixes and enhancements | ||
*/ | ||
@NonNullByDefault | ||
public interface CommunicationController { | ||
void connect() throws IOException; | ||
|
||
void disconnect(); | ||
|
||
byte[] sendRobustRequest(byte[] operation, byte[] register) throws IOException; | ||
|
||
byte[] sendRobustRequest(byte[] operation, byte[] register, byte[] value) throws IOException; | ||
} |
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
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
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
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
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.