2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

49_SSCam: fix autocreate bug with https

git-svn-id: https://svn.fhem.de/fhem/trunk@21684 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-04-14 20:02:29 +00:00
parent 621e04a500
commit 51d017bb75
2 changed files with 25 additions and 19 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- bugfix: 49_SSCam: fix autocreate bug with https
- change: 37_echodevice.pm more loginformations set "NPM_login new" - change: 37_echodevice.pm more loginformations set "NPM_login new"
- bugfix: 88_HMCCU: corrected var command - bugfix: 88_HMCCU: corrected var command
- bugfix: 73_AutoShuttersControl: fix roommate absent - bugfix: 73_AutoShuttersControl: fix roommate absent

View File

@ -54,6 +54,7 @@ eval "use Cache::Cache;1;" or my $SScamMMCacheCache = "Cache::Cache";
# Versions History intern # Versions History intern
our %SSCam_vNotesIntern = ( our %SSCam_vNotesIntern = (
"9.2.2" => "14.04.2020 increase read timeout of Redis server cache, fix autocreate bug with https ",
"9.2.1" => "24.02.2020 set compatibility to SVS version 8.2.7 ", "9.2.1" => "24.02.2020 set compatibility to SVS version 8.2.7 ",
"9.2.0" => "10.12.2019 attribute \"recChatTxt\" for sending recordings by SSChatBot ", "9.2.0" => "10.12.2019 attribute \"recChatTxt\" for sending recordings by SSChatBot ",
"9.1.0" => "08.12.2019 attribute \"snapChatTxt\" for sending snapshots by SSChatBot ", "9.1.0" => "08.12.2019 attribute \"snapChatTxt\" for sending snapshots by SSChatBot ",
@ -5887,8 +5888,7 @@ sub SSCam_camop_parse ($) {
} }
} }
} else { } else {
for my $kn ($ss..($sgn-1)) { for my $kn ($ss..($sgn-1)) {
# next if $kn >= $hash->{HELPER}{SNAPLIMIT};
$g = SSCam_cache($name, "c_read", "{SNAPOLDHASH}{$sn}{snapid}"); $g = SSCam_cache($name, "c_read", "{SNAPOLDHASH}{$sn}{snapid}");
SSCam_cache($name, "c_write", "{SNAPHASH}{$kn}{snapid}", $g) if(defined $g); SSCam_cache($name, "c_write", "{SNAPHASH}{$kn}{snapid}", $g) if(defined $g);
SSCam_cache($name, "c_remove", "{SNAPOLDHASH}{$sn}{snapid}"); SSCam_cache($name, "c_remove", "{SNAPOLDHASH}{$sn}{snapid}");
@ -6963,23 +6963,23 @@ sub SSCam_Autocreate ($$) {
if(!$camhash) { if(!$camhash) {
$camname = "SSCam.".makeDeviceName($sn); # erlaubten Kameranamen für FHEM erzeugen $camname = "SSCam.".makeDeviceName($sn); # erlaubten Kameranamen für FHEM erzeugen
my $arg = $hash->{SERVERADDR}." ".$hash->{SERVERPORT}; my $arg = $hash->{SERVERADDR}." ".$hash->{SERVERPORT}." ".$hash->{PROTOCOL};
$cmd = "$camname $type $sn $arg"; $cmd = "$camname $type $sn $arg";
Log3($name, 2, "$name - Autocreate camera: define $cmd"); Log3($name, 2, "$name - Autocreate camera: define $cmd");
$err = CommandDefine(undef, $cmd); $err = CommandDefine(undef, $cmd);
if($err) { if($err) {
Log3($name, 1, "ERROR: $err"); Log3($name, 1, "ERROR: $err");
} else { } else {
my $room = AttrVal($name, "room", "SSCam"); my $room = AttrVal($name, "room", "SSCam");
my $session = AttrVal($name, "session", "DSM"); my $session = AttrVal($name, "session", "DSM");
CommandAttr(undef,"$camname room $room"); CommandAttr (undef,"$camname room $room");
CommandAttr(undef,"$camname session $session"); CommandAttr (undef,"$camname session $session");
CommandAttr(undef,"$camname icon it_camera"); CommandAttr (undef,"$camname icon it_camera");
CommandAttr(undef,"$camname devStateIcon .*isable.*:set_off .*nap:li_wht_on"); CommandAttr (undef,"$camname devStateIcon .*isable.*:set_off .*nap:li_wht_on");
CommandAttr(undef,"$camname pollcaminfoall 210"); CommandAttr (undef,"$camname pollcaminfoall 210");
CommandAttr(undef,"$camname pollnologging 1"); CommandAttr (undef,"$camname pollnologging 1");
CommandAttr(undef,"$camname httptimeout 20"); CommandAttr (undef,"$camname httptimeout 20");
# Credentials abrufen und setzen # Credentials abrufen und setzen
my ($success, $username, $password) = SSCam_getcredentials($hash,0,"svs"); my ($success, $username, $password) = SSCam_getcredentials($hash,0,"svs");
@ -10149,8 +10149,8 @@ sub SSCam_cache ($$;$$) {
return 0; return 0;
} }
my $cto = 0.5; my $cto = 0.5;
my $rto = 0.5; my $rto = 2.0;
my $wto = 0.5; my $wto = 1.0;
my %Redispars = ( cnx_timeout => $cto, my %Redispars = ( cnx_timeout => $cto,
read_timeout => $rto, read_timeout => $rto,
write_timeout => $wto write_timeout => $wto
@ -10176,6 +10176,7 @@ sub SSCam_cache ($$;$$) {
$cache = CHI->new( driver => 'Redis', $cache = CHI->new( driver => 'Redis',
namespace => $fuuid, namespace => $fuuid,
server => "$server:$port", server => "$server:$port",
reconnect => 1,
on_set_error => 'warn', on_set_error => 'warn',
on_get_error => 'warn', on_get_error => 'warn',
redis_options => \%Redispars, redis_options => \%Redispars,
@ -10277,9 +10278,13 @@ sub SSCam_cache ($$;$$) {
# aus Cache lesen # aus Cache lesen
if($op eq "c_read") { if($op eq "c_read") {
my $g = $cache->get($key); my $g = $cache->get($key);
$brt = tv_interval($bst); $brt = tv_interval($bst);
Log3($name, 1, "$name - Cache time read key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0)); Log3($name, 1, "$name - Cache time read key \"$key\": ".$brt) if(AttrVal($name,"debugCachetime",0));
return $g; if(!$g) {
return "";
} else {
return $g;
}
} }
# einen Key entfernen # einen Key entfernen