FIX: improved state handling for children

This commit is contained in:
Dominik Meyer 2024-02-18 21:09:17 +01:00
parent 9f8f6afa64
commit 68b3247c23
Signed by: byterazor
GPG Key ID: EABDA0FD5981BC97

View File

@ -120,7 +120,7 @@ sub NTFY_Define
$hash->{NAME} = $name;
$hash->{SERVER} = $params->[2];
$hash->{STATE} = "offline";
$hash->{STATE} = "unknown";
$hash->{USERNAME} = $h->{user} || "";
$hash->{helper}{PASSWORD} = $h->{password};
$hash->{DEFAULT_TOPIC} = $h->{topic};
@ -232,8 +232,8 @@ sub NTFY_WS_Handshake
DevIo_SimpleWrite( $hash, '', 2 );
NTFY_LOG(LOG_ERROR, "websocket connected");
DoTrigger($hash->{PNAME}, "online");
readingsSingleUpdate($hash, "state", "online", 1);
}
sub NTFY_WS_CB