Improved the command handler functions within the Nuki Bridge module
by standardizing return statements for consistency. Each command now
immediately returns after assigning its respective endpoint, ensuring
clearer control flow. This change simplifies the readability of the
code and ensures that all command handlers consistently exit without
proceeding further when their conditions are met.
Additionally, unnecessary checks for the endpoint were removed,
streamlining the handling of responses. These adjustments should help
reduce confusion and make future modifications easier, without
introducing any breaking changes.
Improved the Nuki Bridge module by updating the version to v2.1.1,
indicating a minor enhancement likely related to internal changes or
bug fixes.
Additionally, in the `Set` and `Get` methods, updated the return
conditions to exclude the endpoint from the results when it
matches the output from the command handlers. This change ensures
that the endpoint is not returned as part of the command
responses, which could lead to confusion and unintended behavior
for users interacting with the API.
These modifications enhance the clarity and reliability of the
responses provided by the Nuki Bridge API.
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.
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.
The Nuki Bridge and Device modules have been updated to version 2.1.0.
Key changes include enhancements to the command handling within the
Bridge module, replacing the `given/when` construct with a more
flexible hash-based dispatcher for clarity and maintainability.
Additionally, minor refinements have been made in the Device module,
including improved reading updates and handling of last known
device states. The experimental feature switch has been commented
out, ensuring compatibility with standard Perl versions.
These updates improve the overall robustness and readability of the
code, making it easier to maintain and extend in future versions.
No breaking changes have been introduced.