From aa8efed2b2447e1aead142b2ced65c6a60181782 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Sat, 26 Oct 2024 04:30:03 +0000 Subject: [PATCH] speechcontrol.template: fix typo git-svn-id: https://svn.fhem.de/fhem/trunk@29295 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/speechcontrol.template | 4 ++-- fhem/contrib/RHASSPY/99_RHASSPY_Utils_Demo.pm | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/speechcontrol.template b/fhem/FHEM/lib/AttrTemplate/speechcontrol.template index 6aec8e35e..6a054c420 100644 --- a/fhem/FHEM/lib/AttrTemplate/speechcontrol.template +++ b/fhem/FHEM/lib/AttrTemplate/speechcontrol.template @@ -126,7 +126,7 @@ par:RADIO_KEEPalexaNAME;Keep current attribute value;{ defined AttrVal('DEVICE', par:RADIO_SETalexaNAME;Set a new alexaName;{ undef } par:RADIO_DoNotSetalexaName;Leave alexaName attribute empty;{ defined AttrVal('DEVICE','alexaName',undef) ? 0 : undef } par:RADIO_Delete_gDT;Discard genericDeviceType attribute;{ undef } -par:RADIO_SKIPP_SCONTROLL;Skipp setting speech controll specific attributes;{ undef } +par:RADIO_SKIP_SCONTROLL;Skip setting speech controll specific attributes;{ undef } option:{ RADIO_KEEPalexaNAME } set DEVICE attrTemplate speechcontrol_siri_specials CHECKGDTDONE=1 option:{ RADIO_Delete_gDT } @@ -136,7 +136,7 @@ deleteAttr DEVICE alexaName #optional falls Name zuvor vorhanden set DEVICE attrTemplate speechcontrol_siri_specials CHECKGDTDONE=1 option:{ RADIO_SETalexaNAME } set DEVICE attrTemplate speechcontrol_request_alexaName -option:{ RADIO_SKIPP_SCONTROLL } +option:{ RADIO_SKIP_SCONTROLL } set DEVICE attrTemplate speechcontrol_siri_specials CHECKGDTDONE=1 SKIPSCONTROLL=1 diff --git a/fhem/contrib/RHASSPY/99_RHASSPY_Utils_Demo.pm b/fhem/contrib/RHASSPY/99_RHASSPY_Utils_Demo.pm index 56b1f0d81..db729da29 100644 --- a/fhem/contrib/RHASSPY/99_RHASSPY_Utils_Demo.pm +++ b/fhem/contrib/RHASSPY/99_RHASSPY_Utils_Demo.pm @@ -44,8 +44,8 @@ sub Initialize { # Enter you functions below _this_ line. sub BasicTest { - my $site = shift; - my $type = shift; + my $site = shift // return 'No site argument provided!'; + my $type = shift // return 'No type argument provided!'; Log3('rhasspy',3 , "RHASSPY: Site $site, Type $type"); return "RHASSPY: Site $site, Type $type"; } @@ -56,7 +56,7 @@ sub DataTest { my $hash = $defs{$name} // return; my $data; - if ( !eval { $data = decode_json($rawd) ; 1 } ) { + if ( !eval { $data = JSON->new->decode($rawd) ; 1 } ) { Log3($hash->{NAME}, 1, "JSON decoding error, $rawd seems not to be valid JSON data: $@"); return "Error! $rawd seems not to be valid JSON data!"; } @@ -75,12 +75,12 @@ sub DataTest { } sub DialogueTest{ - my $name = shift; - my $rawd = shift; + my $name = shift // return 'No RHASSPY name argument provided!'; + my $rawd = shift // return 'No JSON data argument provided!'; - my $hash = $defs{$name} // return; + my $hash = $defs{$name} // return "RHASSPY name doesn't exist!"; my $data; - if ( !eval { $data = decode_json($rawd) ; 1 } ) { + if ( !eval { $data = JSON->new->decode($rawd) ; 1 } ) { Log3($hash->{NAME}, 1, "JSON decoding error, $rawd seems not to be valid JSON data: $@"); return "Error! $rawd seems not to be valid JSON data!"; }