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:
parent
462e2f3a0f
commit
39f707c8d1
@ -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.
|
||||||
|
- change: 49_SSCamSTRM: switch time increases with each adoptForTimer command
|
||||||
- feature: 10_pilight_ctrl: support relay switch protocol
|
- feature: 10_pilight_ctrl: support relay switch protocol
|
||||||
- feature: 49_SSCamSTRM: new commands adoptForTimer / adoptTime in master devs
|
- feature: 49_SSCamSTRM: new commands adoptForTimer / adoptTime in master devs
|
||||||
- feature: 74_XiaomiBTLESens: add Support for Mijia LYWSD03MMC
|
- feature: 74_XiaomiBTLESens: add Support for Mijia LYWSD03MMC
|
||||||
|
@ -91,6 +91,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
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.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.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 ",
|
"2.13.0" => "14.07.2020 integrate streamDev master ",
|
||||||
@ -440,11 +441,11 @@ sub _setadoptForTimer { ## no critic "not used"
|
|||||||
my $hash = $paref->{hash};
|
my $hash = $paref->{hash};
|
||||||
my $name = $paref->{name};
|
my $name = $paref->{name};
|
||||||
my $opt = $paref->{opt};
|
my $opt = $paref->{opt};
|
||||||
my $odev = $paref->{odev}; # bisheriges adoptiertes Device (wird erst im InternalTimer gesetzt und verwendet)
|
my $odev = $paref->{odev}; # bisheriges adoptiertes Device (wird erst im InternalTimer gesetzt und verwendet)
|
||||||
|
|
||||||
my $atime = ReadingsVal($name, "adoptTimer", 10);
|
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) {
|
if ($init_done != 1) {
|
||||||
InternalTimer(gettimeofday()+3, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
|
InternalTimer(gettimeofday()+3, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
|
||||||
@ -455,11 +456,17 @@ sub _setadoptForTimer { ## no critic "not used"
|
|||||||
|
|
||||||
my $sdev;
|
my $sdev;
|
||||||
|
|
||||||
if(!$odev) { # Step 1 -> erster Durchlauf ohne odef
|
if(!$odev) { # Step 1 -> erster Durchlauf ohne odef
|
||||||
$paref->{odev} = $hash->{LINKNAME}; # bisheriges adoptiertes Device in %params aufnehmen, InternalTimer mitgeben
|
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
|
} else { # Step 2 -> zweiter Durchlauf mit odef gesetzt
|
||||||
my @a;
|
my @a;
|
||||||
|
delete $hash->{HELPER}{SWITCHED};
|
||||||
$sdev = $odev eq $name ? "--reset--" : $odev;
|
$sdev = $odev eq $name ? "--reset--" : $odev;
|
||||||
|
|
||||||
push @a, $name;
|
push @a, $name;
|
||||||
@ -469,7 +476,7 @@ sub _setadoptForTimer { ## no critic "not used"
|
|||||||
$paref->{aref} = \@a;
|
$paref->{aref} = \@a;
|
||||||
}
|
}
|
||||||
|
|
||||||
no strict "refs"; ## no critic 'NoStrict'
|
no strict "refs"; ## no critic 'NoStrict'
|
||||||
&{$hset{adopt}{fn}} ($paref);
|
&{$hset{adopt}{fn}} ($paref);
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
|
|
||||||
@ -479,6 +486,7 @@ sub _setadoptForTimer { ## no critic "not used"
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log3($name, 4, qq{$name - Switched to Stream Device "$hash->{LINKNAME}" for $atime seconds});
|
Log3($name, 4, qq{$name - Switched to Stream Device "$hash->{LINKNAME}" for $atime seconds});
|
||||||
|
|
||||||
InternalTimer(gettimeofday()+$atime, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
|
InternalTimer(gettimeofday()+$atime, "FHEM::SSCamSTRM::_setadoptForTimer", $paref, 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user