HotFix Version
This commit is contained in:
@ -42,7 +42,7 @@ use warnings;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $version = "0.1.39";
|
my $version = "0.1.40";
|
||||||
|
|
||||||
|
|
||||||
sub AutoShuttersControl_Initialize($) {
|
sub AutoShuttersControl_Initialize($) {
|
||||||
@ -412,13 +412,16 @@ sub ShuttersDeviceScan($) {
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
|
|
||||||
|
delete $hash->{helper}{shuttersList};
|
||||||
|
|
||||||
my @list;
|
my @list;
|
||||||
@list = devspec2array('AutoShuttersControl=[1-2]');
|
@list = devspec2array('AutoShuttersControl=[1-2]');
|
||||||
|
|
||||||
delete $hash->{helper}{shuttersList};
|
|
||||||
|
|
||||||
unless( scalar(@list) > 0 ) {
|
|
||||||
CommandDeleteReading(undef,$name . ' room_.*');
|
CommandDeleteReading(undef,$name . ' room_.*');
|
||||||
|
CommandDeleteReading(undef,$name . ' .*_nextAstroTimeEvent');
|
||||||
|
CommandDeleteReading(undef,$name . ' .*_lastDelayPosValue');
|
||||||
|
CommandDeleteReading(undef,$name . ' .*_lastPosValue');
|
||||||
|
unless( scalar(@list) > 0 ) {
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdate($hash,'userAttrList','none');
|
readingsBulkUpdate($hash,'userAttrList','none');
|
||||||
readingsBulkUpdate($hash,'state','no shutters found');
|
readingsBulkUpdate($hash,'state','no shutters found');
|
||||||
@ -499,7 +502,7 @@ sub UserAttributs_Readings_ForShutters($$) {
|
|||||||
## Oder das Attribut wird wieder gelöscht.
|
## Oder das Attribut wird wieder gelöscht.
|
||||||
} elsif( $cmd eq 'del' ) {
|
} elsif( $cmd eq 'del' ) {
|
||||||
RemoveInternalTimer(ReadingsVal($_,'.AutoShuttersControl_InternalTimerFuncHash',0));
|
RemoveInternalTimer(ReadingsVal($_,'.AutoShuttersControl_InternalTimerFuncHash',0));
|
||||||
CommandDeleteReading(undef,$_ . ' \.?AutoShuttersControl_.*' );
|
CommandDeleteReading(undef,$_ . ' .?AutoShuttersControl_.*' );
|
||||||
CommandDeleteAttr(undef,$_ . ' AutoShuttersControl');
|
CommandDeleteAttr(undef,$_ . ' AutoShuttersControl');
|
||||||
delFromDevAttrList($_,$attrib);
|
delFromDevAttrList($_,$attrib);
|
||||||
}
|
}
|
||||||
@ -715,20 +718,17 @@ sub CreateSunRiseSetShuttersTimer($$) {
|
|||||||
|
|
||||||
my $shuttersSunriseUnixtime = ShuttersSunrise($hash,$shuttersDev,'unix');
|
my $shuttersSunriseUnixtime = ShuttersSunrise($hash,$shuttersDev,'unix');
|
||||||
my $shuttersSunsetUnixtime = ShuttersSunset($hash,$shuttersDev,'unix');
|
my $shuttersSunsetUnixtime = ShuttersSunset($hash,$shuttersDev,'unix');
|
||||||
#my $shuttersSunriseRealtime = ShuttersSunrise($hash,$shuttersDev,'real');
|
|
||||||
#my $shuttersSunsetRealtime = ShuttersSunset($hash,$shuttersDev,'real');
|
|
||||||
|
|
||||||
|
|
||||||
## In jedem Rolladen werden die errechneten Zeiten hinterlegt, es sei denn das autoShuttersControlEvening/Morning auf off steht
|
## In jedem Rolladen werden die errechneten Zeiten hinterlegt, es sei denn das autoShuttersControlEvening/Morning auf off steht
|
||||||
readingsBeginUpdate($shuttersDevHash);
|
readingsBeginUpdate($shuttersDevHash);
|
||||||
readingsBulkUpdate( $shuttersDevHash,'AutoShuttersControl_Time_Sunset',(AttrVal($name,'AutoShuttersControl_autoShuttersControlEvening','off') eq 'on' ? localtime($shuttersSunsetUnixtime) : 'AutoShuttersControl off') );
|
readingsBulkUpdate( $shuttersDevHash,'AutoShuttersControl_Time_Sunset',(AttrVal($name,'AutoShuttersControl_autoShuttersControlEvening','off') eq 'on' ? localtime($shuttersSunsetUnixtime) : 'AutoShuttersControl off'),1 );
|
||||||
readingsBulkUpdate($shuttersDevHash,'AutoShuttersControl_Time_Sunrise',(AttrVal($name,'AutoShuttersControl_autoShuttersControlMorning','off') eq 'on' ? localtime($shuttersSunriseUnixtime) : 'AutoShuttersControl off') );
|
readingsBulkUpdate($shuttersDevHash,'AutoShuttersControl_Time_Sunrise',(AttrVal($name,'AutoShuttersControl_autoShuttersControlMorning','off') eq 'on' ? localtime($shuttersSunriseUnixtime) : 'AutoShuttersControl off'),1 );
|
||||||
readingsEndUpdate($shuttersDevHash,1);
|
readingsEndUpdate($shuttersDevHash,0);
|
||||||
|
|
||||||
|
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdateIfChanged($hash,$shuttersDev . '_nextAstroTimeEvent',($shuttersSunriseUnixtime < $shuttersSunsetUnixtime ? localtime($shuttersSunriseUnixtime) : localtime($shuttersSunsetUnixtime)));
|
readingsBulkUpdateIfChanged($hash,$shuttersDev . '_nextAstroTimeEvent',($shuttersSunriseUnixtime < $shuttersSunsetUnixtime ? localtime($shuttersSunriseUnixtime) : localtime($shuttersSunsetUnixtime)));
|
||||||
readingsEndUpdate($hash,1);
|
readingsEndUpdate($hash,1);
|
||||||
|
|
||||||
CommandDeleteReading(undef,$name . ' ' . $shuttersDev . '_nextAstroEvent') if( ReadingsVal($name,$shuttersDev . '_nextAstroEvent','none') ne 'none' ); # temporär
|
CommandDeleteReading(undef,$name . ' ' . $shuttersDev . '_nextAstroEvent') if( ReadingsVal($name,$shuttersDev . '_nextAstroEvent','none') ne 'none' ); # temporär
|
||||||
|
|
||||||
|
|
||||||
@ -739,7 +739,6 @@ sub CreateSunRiseSetShuttersTimer($$) {
|
|||||||
|
|
||||||
## Ich brauche beim löschen des InternalTimer den Hash welchen ich mitgegeben habe, dieser muss gesichert werden
|
## Ich brauche beim löschen des InternalTimer den Hash welchen ich mitgegeben habe, dieser muss gesichert werden
|
||||||
readingsSingleUpdate($shuttersDevHash,'.AutoShuttersControl_InternalTimerFuncHash',\%funcHash,0);
|
readingsSingleUpdate($shuttersDevHash,'.AutoShuttersControl_InternalTimerFuncHash',\%funcHash,0);
|
||||||
|
|
||||||
InternalTimer($shuttersSunsetUnixtime, 'AutoShuttersControl::SunSetShuttersAfterTimerFn',\%funcHash ) if( AttrVal($name,'AutoShuttersControl_autoShuttersControlEvening','off') eq 'on' );
|
InternalTimer($shuttersSunsetUnixtime, 'AutoShuttersControl::SunSetShuttersAfterTimerFn',\%funcHash ) if( AttrVal($name,'AutoShuttersControl_autoShuttersControlEvening','off') eq 'on' );
|
||||||
InternalTimer($shuttersSunriseUnixtime, 'AutoShuttersControl::SunRiseShuttersAfterTimerFn',\%funcHash ) if( AttrVal($name,'AutoShuttersControl_autoShuttersControlMorning','off') eq 'on' );
|
InternalTimer($shuttersSunriseUnixtime, 'AutoShuttersControl::SunRiseShuttersAfterTimerFn',\%funcHash ) if( AttrVal($name,'AutoShuttersControl_autoShuttersControlMorning','off') eq 'on' );
|
||||||
}
|
}
|
||||||
@ -749,8 +748,9 @@ sub RenewSunRiseSetShuttersTimer($) {
|
|||||||
|
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
|
|
||||||
|
|
||||||
foreach (@{$hash->{helper}{shuttersList}}) {
|
foreach (@{$hash->{helper}{shuttersList}}) {
|
||||||
CommandDeleteReading(undef,$_ . ' \.AutoShuttersControl_InternalTimerFuncHash' );
|
CommandDeleteReading(undef,$_ . ' .AutoShuttersControl_InternalTimerFuncHash' );
|
||||||
CreateSunRiseSetShuttersTimer($hash,$_);
|
CreateSunRiseSetShuttersTimer($hash,$_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user