mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 01:09:47 +00:00
ENIGMA2: fix readings update for boxinfo
git-svn-id: https://svn.fhem.de/fhem/trunk@4552 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cae105747e
commit
9e58d5ac88
@ -24,7 +24,7 @@
|
|||||||
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Version: 1.2.3
|
# Version: 1.2.4
|
||||||
#
|
#
|
||||||
# Major Version History:
|
# Major Version History:
|
||||||
# - 1.2.0 - 2013-12-21
|
# - 1.2.0 - 2013-12-21
|
||||||
@ -104,8 +104,6 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
my $interval = $hash->{INTERVAL};
|
my $interval = $hash->{INTERVAL};
|
||||||
my $state = '';
|
my $state = '';
|
||||||
my $boxinfo;
|
my $boxinfo;
|
||||||
my $serviceinfo;
|
|
||||||
my $eventinfo;
|
|
||||||
my $currsrvinfo;
|
my $currsrvinfo;
|
||||||
my $signalinfo;
|
my $signalinfo;
|
||||||
my $vol;
|
my $vol;
|
||||||
@ -317,12 +315,15 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
|
|
||||||
# Read Boxinfo every 10 minutes only
|
# Read Boxinfo every 10 minutes only
|
||||||
if (
|
if (
|
||||||
!defined( $hash->{helper}{lastStatusUpdate} )
|
!defined( $hash->{helper}{lastFullUpdate} )
|
||||||
|| ( defined( $hash->{helper}{lastStatusUpdate} )
|
|| ( defined( $hash->{helper}{lastFullUpdate} )
|
||||||
&& $hash->{helper}{lastStatusUpdate} + 900 le time() )
|
&& $hash->{helper}{lastFullUpdate} + 900 le time() )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$boxinfo = ENIGMA2_SendCommand( $hash, "about", "" );
|
$boxinfo = ENIGMA2_SendCommand( $hash, "about", "" );
|
||||||
|
|
||||||
|
# Update state
|
||||||
|
$hash->{helper}{lastFullUpdate} = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
# get current states
|
# get current states
|
||||||
@ -438,7 +439,7 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
$boxinfo->{e2about}{e2hddinfo}[$i]{capacity} );
|
$boxinfo->{e2about}{e2hddinfo}[$i]{capacity} );
|
||||||
if (
|
if (
|
||||||
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
||||||
|| ( ref(@value) eq "ARRAY"
|
|| ( @value
|
||||||
&& $hash->{READINGS}{$readingname}{VAL} ne
|
&& $hash->{READINGS}{$readingname}{VAL} ne
|
||||||
$value[0] )
|
$value[0] )
|
||||||
)
|
)
|
||||||
@ -451,7 +452,7 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
split( / /, $boxinfo->{e2about}{e2hddinfo}[$i]{free} );
|
split( / /, $boxinfo->{e2about}{e2hddinfo}[$i]{free} );
|
||||||
if (
|
if (
|
||||||
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
||||||
|| ( ref(@value) eq "ARRAY"
|
|| ( @value
|
||||||
&& $hash->{READINGS}{$readingname}{VAL} ne
|
&& $hash->{READINGS}{$readingname}{VAL} ne
|
||||||
$value[0] )
|
$value[0] )
|
||||||
)
|
)
|
||||||
@ -479,7 +480,7 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
split( / /, $boxinfo->{e2about}{e2hddinfo}{capacity} );
|
split( / /, $boxinfo->{e2about}{e2hddinfo}{capacity} );
|
||||||
if (
|
if (
|
||||||
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
||||||
|| ( ref(@value) eq "ARRAY"
|
|| ( @value
|
||||||
&& $hash->{READINGS}{$readingname}{VAL} ne $value[0] )
|
&& $hash->{READINGS}{$readingname}{VAL} ne $value[0] )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -490,7 +491,7 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
@value = split( / /, $boxinfo->{e2about}{e2hddinfo}{free} );
|
@value = split( / /, $boxinfo->{e2about}{e2hddinfo}{free} );
|
||||||
if (
|
if (
|
||||||
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
!defined( $hash->{READINGS}{$readingname}{VAL} )
|
||||||
|| ( ref(@value) eq "ARRAY"
|
|| ( @value
|
||||||
&& $hash->{READINGS}{$readingname}{VAL} ne $value[0] )
|
&& $hash->{READINGS}{$readingname}{VAL} ne $value[0] )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -890,9 +891,6 @@ sub ENIGMA2_GetStatus($;$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update state
|
|
||||||
$hash->{helper}{lastStatusUpdate} = time();
|
|
||||||
|
|
||||||
readingsEndUpdate( $hash, 1 );
|
readingsEndUpdate( $hash, 1 );
|
||||||
|
|
||||||
return $hash->{STATE};
|
return $hash->{STATE};
|
||||||
|
Loading…
Reference in New Issue
Block a user