2 Commits

Author SHA1 Message Date
e166a51c45 Bump version to v2.1.1 in NUKIDevice module
Updated the version number in the NUKIDevice module from
v2.1.0 to v2.1.1. This change reflects the introduction of
minor improvements and fixes since the last release.
No breaking changes were introduced, but it's important for
users to be aware of the version increment for their
dependencies and updates.
2025-10-15 06:53:54 +02:00
8524d188d7 Add UTF-8 encoding for reading bulk updates
This commit introduces the use of the `Encode` module to ensure that
values being processed in the `WriteReadings` subroutine are correctly
encoded in UTF-8. The previous implementation did not account for
potential non-UTF-8 encoded data which could lead to issues when
updating readings.

The change specifically checks if the value (`$v`) is marked as UTF-8
using `Encode::is_utf8()`. If it is, the value is re-encoded to UTF-8
before being passed to `::readingsBulkUpdate()`. This adjustment
ensures that all data written to readings maintains proper character
encoding, improving compatibility and preventing potential data
corruption.

No breaking changes are introduced, but it is important for users
to validate that their readings correctly display any special
characters post-update.
2025-10-15 06:44:38 +02:00
3 changed files with 8 additions and 7 deletions

View File

@@ -271,7 +271,7 @@ sub Initialize {
],
"release_status": "stable",
"license": "GPL_2",
"version": "v2.1.0",
"version": "v2.1.1",
"author": [
"Marko Oldenburg <leongaultier@gmail.com>"
],

View File

@@ -1,4 +1,4 @@
UPD 2025-10-14_10:40:53 10358 FHEM/73_NUKIBridge.pm
UPD 2025-10-14_10:41:09 11100 FHEM/74_NUKIDevice.pm
UPD 2025-10-14_10:42:11 42820 lib/FHEM/Devices/Nuki/Bridge.pm
UPD 2025-10-14_10:42:04 16698 lib/FHEM/Devices/Nuki/Device.pm
UPD 2025-10-14_11:00:54 10358 FHEM/73_NUKIBridge.pm
UPD 2025-10-15_06:53:37 11100 FHEM/74_NUKIDevice.pm
UPD 2025-10-14_11:00:54 42820 lib/FHEM/Devices/Nuki/Bridge.pm
UPD 2025-10-15_06:43:51 16775 lib/FHEM/Devices/Nuki/Device.pm

View File

@@ -30,7 +30,7 @@ use strict;
use warnings;
#use experimental qw( switch );
use Encode;
use FHEM::Meta;
use GPUtils qw(GP_Import);
@@ -550,7 +550,8 @@ sub WriteReadings {
while ( ( $t, $v ) = each %{$decode_json} ) {
# generische readings (alles außer spezielle Felder)
::readingsBulkUpdate( $hash, $t, $v )
::readingsBulkUpdate( $hash, $t,
Encode::is_utf8($v) ? Encode::encode( "UTF-8", $v ) : $v )
if ( $t ne 'state'
&& $t ne 'mode'
&& $t ne 'deviceType'