Skip to content

Commit

Permalink
Change bridge config error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed May 28, 2022
1 parent 0578d2e commit a3b9422
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public NikoHomeControlActionHandler(Thing thing) {
public void handleCommand(ChannelUID channelUID, Command command) {
NikoHomeControlCommunication nhcComm = getCommunication();
if (nhcComm == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED,
"@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
return;
}

Expand Down Expand Up @@ -214,7 +214,8 @@ public void initialize() {

NikoHomeControlCommunication nhcComm = getCommunication();
if (nhcComm == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
return;
}

Expand Down Expand Up @@ -342,8 +343,8 @@ private void restartCommunication(NikoHomeControlCommunication nhcComm) {
if (nhcBridgeHandler != null) {
nhcBridgeHandler.bridgeOnline();
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED,
"@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public void initialize() {

NikoHomeControlCommunication nhcComm = getCommunication();
if (nhcComm == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
return;
}

Expand Down Expand Up @@ -221,8 +222,8 @@ private void restartCommunication(NikoHomeControlCommunication nhcComm) {
if (nhcBridgeHandler != null) {
nhcBridgeHandler.bridgeOnline();
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED,
"@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public NikoHomeControlThermostatHandler(Thing thing) {
public void handleCommand(ChannelUID channelUID, Command command) {
NikoHomeControlCommunication nhcComm = getCommunication();
if (nhcComm == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
return;
}

Expand Down Expand Up @@ -155,8 +156,8 @@ public void initialize() {

NikoHomeControlCommunication nhcComm = getCommunication();
if (nhcComm == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED,
"@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
return;
}

Expand Down Expand Up @@ -302,8 +303,8 @@ private void restartCommunication(NikoHomeControlCommunication nhcComm) {
if (nhcBridgeHandler != null) {
nhcBridgeHandler.bridgeOnline();
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED,
"@text/offline.bridge-unitialized");
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.configuration-error.invalid-bridge-handler");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@ offline.configuration-error.energyMeterRemoved = Energy meter has been removed f
offline.configuration-error.thermostatId = Configured thermostat ID does not match an thermostat in controller
offline.configuration-error.thermostatRemoved = Thermostat has been removed from controller

offline.configuration-error.invalid-bridge-handler = Invalid bridge handler

offline.communication-error = Error communicating with controller
offline.bridge-unitialized = Bridge not initialized
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,3 @@ offline.configuration-error.thermostatId = L'ID configuré ne correspond pas à
offline.configuration-error.thermostatRemoved = Le thermostat a été retiré de l'unité de contrôle

offline.communication-error = Erreur de communication avec l'unité de contrôle
offline.bridge-unitialized = Pont de connexion non initialisé
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ offline.configuration-error.thermostatId = Geconfigureerde thermostaat-ID komt n
offline.configuration-error.thermostatRemoved = Thermostaat is verwijderd van de controller

offline.communication-error = Fout tijdens het communiceren met de controller
offline.bridge-unitialized = Bridge niet geïnitialiseerd

Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
<bridge-type-ref id="bridge"/>
<bridge-type-ref id="bridge2"/>
</supported-bridge-type-refs>
<label>@textThermostatLabel</label>
<description>@textThermostatDescription</description>
<label>@text/ThermostatLabel</label>
<description>@text/ThermostatDescription</description>
<channels>
<channel id="measured" typeId="measured"/>
<channel id="mode" typeId="mode"/>
Expand Down

0 comments on commit a3b9422

Please sign in to comment.