Skip to content

Commit 5e0f8d1

Browse files
return on config fail
Signed-off-by: Scott Hanson <scooter_seh@yahoo.com>
1 parent 3d2893a commit 5e0f8d1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

bundles/org.openhab.binding.pirateweather/src/main/java/org/openhab/binding/pirateweather/internal/handler/PirateWeatherAPIHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void initialize() {
8383
if (refreshInterval < 1) {
8484
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
8585
"@text/offline.conf-error-not-supported-refreshInterval");
86-
configValid = false;
86+
return;
8787
}
8888
String language = config.language;
8989
if (language != null && !language.isBlank() && !PirateWeatherAPIConfiguration.SUPPORTED_LANGUAGES.contains(language.toLowerCase())) {

bundles/org.openhab.binding.pirateweather/src/main/java/org/openhab/binding/pirateweather/internal/handler/PirateWeatherWeatherAndForecastHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void initialize() {
130130
if (config.location == null || config.location.isBlank()) {
131131
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
132132
"@text/offline.conf-error-missing-location");
133-
configValid = false;
133+
return;
134134
}
135135

136136
try {
@@ -140,26 +140,26 @@ public void initialize() {
140140
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
141141
"@text/offline.conf-error-parsing-location");
142142
location = null;
143-
configValid = false;
143+
return;
144144
}
145145

146146
int newForecastHours = config.forecastHours;
147147
if (newForecastHours < 0 || newForecastHours > 48) {
148148
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
149149
"@text/offline.conf-error-not-supported-number-of-hours");
150-
configValid = false;
150+
return;
151151
}
152152
int newForecastDays = config.forecastDays;
153153
if (newForecastDays < 0 || newForecastDays > 8) {
154154
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
155155
"@text/offline.conf-error-not-supported-number-of-days");
156-
configValid = false;
156+
return;
157157
}
158158
int newNumberOfAlerts = config.numberOfAlerts;
159159
if (newNumberOfAlerts < 0) {
160160
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
161161
"@text/offline.conf-error-not-supported-number-of-alerts");
162-
configValid = false;
162+
return;
163163
}
164164

165165
if (configValid) {

0 commit comments

Comments
 (0)