Skip to content

Commit

Permalink
[freeathome] Fix not updating values of room temperature devices (#17957
Browse files Browse the repository at this point in the history
)

* Fixed Pathnaming matching new binding name
Signed-off-by: JankKeks <[email protected]>
  • Loading branch information
JankKeks authored Dec 23, 2024
1 parent 2cd8902 commit 5c76284
Show file tree
Hide file tree
Showing 27 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,10 @@ public void setDatapointOnWebsocketFeedback(String receivedText) {

if (deviceHandler != null) {
deviceHandler.onDeviceStateChanged(eventDatapointID, value);
logger.debug("Socket event processed: event-datapoint-ID {} value {}", eventDatapointID, value);
} else {
logger.debug("Socket event not processed: event-datapoint-ID {} value {}", eventDatapointID, value);
}

logger.debug("Socket event processed: event-datapoint-ID {} value {}", eventDatapointID, value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ public void handleCommand(ChannelUID channelUID, Command command) {
if (dpg == null) {
logger.debug("Handle command for device (but invalid datapointgroup) {} - at channel {} - full command {}",
device.getDeviceId(), channelUID.getAsString(), command.toFullString());

updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/conf-error.invalid-deviceconfig");
} else {
Expand Down Expand Up @@ -480,8 +479,7 @@ public void updateChannels() throws FreeAtHomeGeneralException {
channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID);
}

ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId(),
dpg.getLabel().substring(4));
ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());

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

ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId());
ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());

FreeAtHomeDatapoint outputDatapoint = dpg.getOutputDatapoint();

Expand All @@ -589,6 +587,11 @@ private void reloadChannelTypes() throws FreeAtHomeGeneralException {
}
}

// Create a channel UID. Makes sure that the channel UID is unique and generated the same way every time
private ChannelUID createChannelUID(ThingUID thingUID, String channelID, String dpgLabel) {
return new ChannelUID(thingUID, channelID, dpgLabel.substring(4));
}

public void removeChannels() {
Bridge bridge = this.getBridge();

Expand Down

0 comments on commit 5c76284

Please sign in to comment.