fix state water_controler

This commit is contained in:
Marko Oldenburg 2020-04-30 12:26:45 +02:00
parent c357ab9dbc
commit 577f686e51

View File

@ -610,12 +610,8 @@ sub WriteReadings {
readingsBulkUpdate( readingsBulkUpdate(
$hash, 'state', $hash, 'state',
( (
( ReadingsVal( $name, 'watering-watering_timer_1_duration', 0 )
ReadingsVal( $name, 'watering-watering_timer_1_state', 'open' ) =~ m{\A[1-9]([0-9]+)?\z}xms
eq 'open'
|| ReadingsVal( $name, 'watering-watering_timer_1_state',
'offen' ) eq 'offen'
)
? RigReadingsValue( $hash, 'open' ) ? RigReadingsValue( $hash, 'open' )
: RigReadingsValue( $hash, 'closed' ) : RigReadingsValue( $hash, 'closed' )
) )