From 6b8982deba153489d29609b3e33784839876d38d Mon Sep 17 00:00:00 2001 From: roelb <> Date: Thu, 28 May 2020 19:45:11 +0000 Subject: [PATCH] 58_HVAC_DaikinAC: added on and off shortcut commands so that the module works out-of-the box with other modules that expect those, for example Alexa git-svn-id: https://svn.fhem.de/fhem/trunk@22052 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 +++ fhem/FHEM/58_HVAC_DaikinAC.pm | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 8c37bdf86..6b5437bd4 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,8 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 58_HVAC_DaikinAC: added on and off shortcut commands so that + the module works out-of-the box with other modules that + expect those, for example Alexa - feature: 60_Watches: countDownInit accept format only - bugfix: 98_RandomTimer: prevent irritations whith 78 or 4we,!$we timespecs; some PBP related changes. diff --git a/fhem/FHEM/58_HVAC_DaikinAC.pm b/fhem/FHEM/58_HVAC_DaikinAC.pm index d536cf510..25e1d7101 100644 --- a/fhem/FHEM/58_HVAC_DaikinAC.pm +++ b/fhem/FHEM/58_HVAC_DaikinAC.pm @@ -28,6 +28,7 @@ use Blocking; # REMINDER: Don't forget to update version number in META.json info at bottom of file # our %HVAC_DaikinAC_VERSION = ( + "1.0.9" => "28.05.2020 Added on and off shortcut commands, as expected by for example the Alexa module", "1.0.8" => "21.04.2020 Initial checkin into FHEM repository. Fixed some syntax errors in documentation HTML. No code changes", "1.0.7" => "11.04.2020 Added two examples to define Usage error and documentation; add interval and interval_powered attributes on startup for clarity; Poll daily and monthly power usage statistics once per hour, so that the current days and current months usage are represented correctly", "1.0.6" => "04.04.2020 Bugfix in pwrconsumption code that caused 'Label not found' error", @@ -384,6 +385,14 @@ sub HVAC_DaikinAC_Set($@) { return undef; }; $hash->{"INITIALIZED"} or return "Not initialized - nu current values"; + $cmd eq "on" && do { + $s = "pow=1"; + last SWITCH; + }; + $cmd eq "off" && do { + $s = "pow=0"; + last SWITCH; + }; $cmd eq "power" && do { my $val = shift @a or goto usage;; my %str2i = qw(off 0 on 1); @@ -470,7 +479,9 @@ usage: "reboot:nodata" . " " . "shum:slider,0,5,100" . " " . "stemp:slider,18,0.5,30" . " " . - "power:on,off"; + "power:on,off" . " " . + "on" . " " . + "off"; } # Set() # Attr @@ -1187,6 +1198,8 @@ attr [devicename] devStateIcon off.*:control_standby@gray on.*cool:frost@blue on