[freeathome] Fix not updating values of room temperature devices (#17957)

* Fixed Pathnaming matching new binding name
Signed-off-by: JankKeks <jan.krumnow@gmx.de>
This commit is contained in:
JankKeks 2024-12-23 14:21:53 +01:00 committed by GitHub
parent 2cd8902017
commit 5c762848b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 10 additions and 6 deletions

View File

@ -429,9 +429,10 @@ public class FreeAtHomeBridgeHandler extends BaseBridgeHandler implements WebSoc
if (deviceHandler != null) { if (deviceHandler != null) {
deviceHandler.onDeviceStateChanged(eventDatapointID, value); 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);
} }
} }
} }

View File

@ -291,7 +291,6 @@ public class FreeAtHomeDeviceHandler extends BaseThingHandler implements FreeAtH
if (dpg == null) { if (dpg == null) {
logger.debug("Handle command for device (but invalid datapointgroup) {} - at channel {} - full command {}", logger.debug("Handle command for device (but invalid datapointgroup) {} - at channel {} - full command {}",
device.getDeviceId(), channelUID.getAsString(), command.toFullString()); device.getDeviceId(), channelUID.getAsString(), command.toFullString());
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/conf-error.invalid-deviceconfig"); "@text/conf-error.invalid-deviceconfig");
} else { } else {
@ -480,8 +479,7 @@ public class FreeAtHomeDeviceHandler extends BaseThingHandler implements FreeAtH
channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID); channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID);
} }
ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId(), ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());
dpg.getLabel().substring(4));
String channelLabel = String.format("%s", String channelLabel = String.format("%s",
i18nProvider.getText(bundle, dpg.getLabel(), "-", locale)); i18nProvider.getText(bundle, dpg.getLabel(), "-", locale));
@ -568,7 +566,7 @@ public class FreeAtHomeDeviceHandler extends BaseThingHandler implements FreeAtH
channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID); channelTypeUID = createChannelTypeForDatapointgroup(dpg, channelTypeUID);
} }
ChannelUID channelUID = new ChannelUID(thingUID, channel.getChannelId()); ChannelUID channelUID = createChannelUID(thingUID, channel.getChannelId(), dpg.getLabel());
FreeAtHomeDatapoint outputDatapoint = dpg.getOutputDatapoint(); FreeAtHomeDatapoint outputDatapoint = dpg.getOutputDatapoint();
@ -589,6 +587,11 @@ public class FreeAtHomeDeviceHandler extends BaseThingHandler implements FreeAtH
} }
} }
// 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() { public void removeChannels() {
Bridge bridge = this.getBridge(); Bridge bridge = this.getBridge();