Refactor language handling in Weather API
Improved the language initialization logic by replacing the experimental `given/when` construct with a more standard `if/elsif` structure, enhancing code readability and maintainability. The attribute handling in the `Attr` subroutine was also refactored for clarity, removing unnecessary usage of `given/when`, which helps reduce complexity throughout the codebase. In the OpenWeatherMapAPI module, the logic for handling weather response data was streamlined by removing `given/when` statements in favor of `if` conditions. This change avoids potential confusion and enhances the clarity of the code logic. No breaking changes were introduced; the overall functionality remains intact.
This commit is contained in:
@@ -6,7 +6,6 @@ use FHEM::Meta;
|
||||
|
||||
use POSIX;
|
||||
use HttpUtils;
|
||||
use experimental qw /switch/;
|
||||
use Encode;
|
||||
|
||||
my $META = {};
|
||||
|
Reference in New Issue
Block a user