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

49_SSCamSTRM: switch time increases with each adoptForTimer command

git-svn-id: https://svn.fhem.de/fhem/trunk@22487 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-07-28 20:29:34 +00:00
parent 462e2f3a0f
commit 39f707c8d1
2 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# 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.
- change: 49_SSCamSTRM: switch time increases with each adoptForTimer command
- feature: 10_pilight_ctrl: support relay switch protocol
- feature: 49_SSCamSTRM: new commands adoptForTimer / adoptTime in master devs
- feature: 74_XiaomiBTLESens: add Support for Mijia LYWSD03MMC

View File

@ -91,6 +91,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"2.14.1" => "28.07.2020 switching time increases with each adoptForTimer command ",
"2.14.0" => "27.07.2020 new commands adoptForTimer and control command adoptTime ",
"2.13.1" => "21.07.2020 fix: set of values in attr adoptSubset is empty after restart, changes according level 3 PBP ",
"2.13.0" => "14.07.2020 integrate streamDev master ",
@ -444,7 +445,7 @@ sub _setadoptForTimer { ## no critic "not used"
my $atime = ReadingsVal($name, "adoptTimer", 10);
RemoveInternalTimer($hash, "FHEM::SSCamSTRM::_setadoptForTimer");
RemoveInternalTimer("", "FHEM::SSCamSTRM::_setadoptForTimer"); # $paref nicht checken ! da immer unikat
if ($init_done != 1) {
InternalTimer(gettimeofday()+3, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
@ -456,10 +457,16 @@ sub _setadoptForTimer { ## no critic "not used"
my $sdev;
if(!$odev) { # Step 1 -> erster Durchlauf ohne odef
if(!$hash->{HELPER}{SWITCHED}) {
$paref->{odev} = $hash->{LINKNAME}; # bisheriges adoptiertes Device in %params aufnehmen, InternalTimer mitgeben
$hash->{HELPER}{SWITCHED} = $hash->{LINKNAME};
} else {
$paref->{odev} = $hash->{HELPER}{SWITCHED};
}
} else { # Step 2 -> zweiter Durchlauf mit odef gesetzt
my @a;
delete $hash->{HELPER}{SWITCHED};
$sdev = $odev eq $name ? "--reset--" : $odev;
push @a, $name;
@ -479,6 +486,7 @@ sub _setadoptForTimer { ## no critic "not used"
}
Log3($name, 4, qq{$name - Switched to Stream Device "$hash->{LINKNAME}" for $atime seconds});
InternalTimer(gettimeofday()+$atime, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
return;