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.
[AirQuality] Tagging channels, prepared for Crowdin, dynamic channels (…
…openhab#11192) * Adding semantic tags Adding alert level and code refined. Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Commiting intermediate work Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Complete review of the binding. Added measures for each pollutant. Added extensible channel for pollutant sensibility. Signed-off-by: clinique <gael@lhopital.org> * Finishing translation Signed-off-by: Gaël L'hopital <gael@lhopital.org> * One last code cleansing to be ready to push Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Documentation updates Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Spotless apply Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Correcting conflicting file Signed-off-by: Gaël L'hopital <gael@lhopital.org> * Code review correction Signed-off-by: Gael L'hopital <gael@lhopital.org> * Introducing a bridge to Api Signed-off-by: clinique <gael@lhopital.org> * Code review correction Signed-off-by: clinique <gael@lhopital.org> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
- Loading branch information
1 parent
b640f5a
commit 17d4782
Showing
31 changed files
with
1,391 additions
and
715 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
...airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityException.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,46 @@ | ||
/** | ||
* 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.airquality.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
|
||
/** | ||
* An exception that occurred while operating the binding | ||
* | ||
* @author Gaël L'hopital - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class AirQualityException extends Exception { | ||
private static final long serialVersionUID = -3398100220952729815L; | ||
private int statusCode = -1; | ||
|
||
public AirQualityException(String message, Exception e) { | ||
super(message, e); | ||
} | ||
|
||
public AirQualityException(String message) { | ||
super(message); | ||
} | ||
|
||
public int getStatusCode() { | ||
return statusCode; | ||
} | ||
|
||
@Override | ||
public @Nullable String getMessage() { | ||
String message = super.getMessage(); | ||
return message == null ? null | ||
: String.format("Rest call failed: statusCode=%d, message=%s", statusCode, message); | ||
} | ||
} |
Oops, something went wrong.