From 38fcefa9c48faaa2ede3c3cbaf6084d433219c81 Mon Sep 17 00:00:00 2001
From: Beta-User
Date: Thu, 19 May 2022 16:42:31 +0000
Subject: [PATCH] 10_RHASSPY: fix confirmation after choice bug
git-svn-id: https://svn.fhem.de/fhem/trunk@26061 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/contrib/RHASSPY/10_RHASSPY.pm | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/fhem/contrib/RHASSPY/10_RHASSPY.pm b/fhem/contrib/RHASSPY/10_RHASSPY.pm
index c37ba13d7..e3da7a35a 100644
--- a/fhem/contrib/RHASSPY/10_RHASSPY.pm
+++ b/fhem/contrib/RHASSPY/10_RHASSPY.pm
@@ -2015,8 +2015,14 @@ sub getDeviceByName {
&& defined $hash->{helper}{devicemap}{devices}{$dev}{prio}->{outsideRoom}
&& $hash->{helper}{devicemap}{devices}{$dev}{prio}->{outsideRoom} =~ m{\b$type\b}xms;
if ( $intent ) {
- push @maybees, $dev if defined $hash->{helper}{devicemap}{devices}{$dev}->{intents}
- && defined $hash->{helper}{devicemap}{devices}{$dev}{intents}->{$intent};
+ if ( $type ) {
+ push @maybees, $dev if defined $hash->{helper}{devicemap}{devices}{$dev}->{intents}
+ && defined $hash->{helper}{devicemap}{devices}{$dev}{intents}->{$intent}
+ && defined $hash->{helper}{devicemap}{devices}{$dev}{intents}->{$intent}->{$type};
+ } else {
+ push @maybees, $dev if defined $hash->{helper}{devicemap}{devices}{$dev}->{intents}
+ && defined $hash->{helper}{devicemap}{devices}{$dev}{intents}->{$intent};
+ }
} else {
push @maybees, $dev;
}
@@ -5731,13 +5737,14 @@ sub handleIntentConfirmAction {
$data_old->{Confirmation} = 1;
my $intent = $data_old->{intent};
+ delete $hash->{helper}{'.delayed'}{$identity};
my $device = $hash->{NAME};
# Passenden Intent-Handler aufrufen
if (ref $dispatchFns->{$intent} eq 'CODE') {
$device = $dispatchFns->{$intent}->($hash, $data_old);
}
- delete $hash->{helper}{'.delayed'}{$identity};
+ #delete $hash->{helper}{'.delayed'}{$identity};
return $device;
}
@@ -5766,7 +5773,7 @@ sub handleIntentChoice {
if (ref $dispatchFns->{$intent} eq 'CODE') {
$device = $dispatchFns->{$intent}->($hash, $data_old);
}
- delete $hash->{helper}{'.delayed'}{$identity};
+ #delete $hash->{helper}{'.delayed'}{$identity};
return $device;
}
@@ -6692,15 +6699,15 @@ yellow=rgb FFFF00
GetTime
GetDate
Timer Timer info as described in SetTimedOnOff is mandatory, {Room} and/or {Label} are optional to distinguish between different timers. {CancelTimer} key will force RHASSPY to try to remove a running timer (using optional {Room} and/or {Label} key to identify the respective timer), {GetTimer} key will be treated as request if there's a timer running (optionally also identified by {Room} and/or {Label} keys).
+ SetTimer (Outdated, use generic "Timer" instead!) Set a timer, required info as mentionned in Timer
Required tags to set a timer: at least one of {Hour}, {Hourabs}, {Min} or {Sec}. {Label} and {Room} are optional to distinguish between different timers. If {Hourabs} is provided, all timer info will be regarded as absolute time of day info, otherwise everything is calculated using a "from now" logic.
- SetTimer Set a timer, required info as mentionned in Timer
- GetTimer Get timer info as mentionned in Timer, key {GetTimer} is not explicitely required.
+ GetTimer (Outdated, use generic "Timer" instead!) Get timer info as mentionned in Timer, key {GetTimer} is not explicitely required.
ConfirmAction
{Mode} with value 'OK'. All other calls will be interpreted as CancelAction intent call.
CancelAction{Mode} is recommended.
ChoiceOne or more of {Room}, {Device} or {Scene}
- ChoiceRoom{Room}
- ChoiceDevice{Device}
+ ChoiceRoom {Room} NOTE: Useage of generic "Choice" intent instead is highly recommended!
+ ChoiceDevice {Device} NOTE: Useage of generic "Choice" intent instead is highly recommended!
ReSpeak