Skip to content

Commit 5c76284

Browse files
authored
[freeathome] Fix not updating values of room temperature devices (openhab#17957)
* Fixed Pathnaming matching new binding name Signed-off-by: JankKeks <[email protected]>
1 parent 2cd8902 commit 5c76284

27 files changed

+10
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,10 @@ public void setDatapointOnWebsocketFeedback(String receivedText) {
429429

430430
if (deviceHandler != null) {
431431
deviceHandler.onDeviceStateChanged(eventDatapointID, value);
432+
logger.debug("Socket event processed: event-datapoint-ID {} value {}", eventDatapointID, value);
433+
} else {
434+
logger.debug("Socket event not processed: event-datapoint-ID {} value {}", eventDatapointID, value);
432435
}
433-
434-
logger.debug("Socket event processed: event-datapoint-ID {} value {}", eventDatapointID, value);
435436
}
436437
}
437438
}
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
291291
if (dpg == null) {
292292
logger.debug("Handle command for device (but invalid datapointgroup) {} - at channel {} - full command {}",
293293
device.getDeviceId(), channelUID.getAsString(), command.toFullString());
294-
295294
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
296295
"@text/conf-error.invalid-deviceconfig");
297296
} else {
@@ -480,8 +479,7 @@ public void updateChannels() throws FreeAtHomeGeneralException {
480479
channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID);
481480
}
482481

483-
ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId(),
484-
dpg.getLabel().substring(4));
482+
ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());
485483

486484
String channelLabel = String.format("%s",
487485
i18nProvider.getText(bundle, dpg.getLabel(), "-", locale));
@@ -568,7 +566,7 @@ private void reloadChannelTypes() throws FreeAtHomeGeneralException {
568566
channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID);
569567
}
570568

571-
ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId());
569+
ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());
572570

573571
FreeAtHomeDatapoint outputDatapoint = dpg.getOutputDatapoint();
574572

@@ -589,6 +587,11 @@ private void reloadChannelTypes() throws FreeAtHomeGeneralException {
589587
}
590588
}
591589

590+
// Create a channel UID. Makes sure that the channel UID is unique and generated the same way every time
591+
private ChannelUID createChannelUID(ThingUID thingUID, String channelID, String dpgLabel) {
592+
return new ChannelUID(thingUID, channelID, dpgLabel.substring(4));
593+
}
594+
592595
public void removeChannels() {
593596
Bridge bridge = this.getBridge();
594597

0 commit comments

Comments
 (0)