2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

48_BlinkCamera: Correction for JSON values on enabled - true/false 1/0

git-svn-id: https://svn.fhem.de/fhem/trunk@22530 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
viegener 2020-08-03 13:21:58 +00:00
parent c490214b71
commit 2e481dc090

View File

@ -58,11 +58,10 @@
# New default 1 for homescreenv3 - old apis deactivated # New default 1 for homescreenv3 - old apis deactivated
# Disclaimer for API changes # Disclaimer for API changes
# Corrected handling of prefered network attribute # Corrected handling of prefered network attribute
# Adapt active handling to new format # Adapt active handling to new format
# Add new reading Enabled per camera with doc - showing enabled value # Add new reading Enabled per camera with doc - showing enabled value
# # Correction for JSON values - true/false 1/0
# #
# #
# #
@ -1459,8 +1458,11 @@ sub BlinkCamera_ParseHomescreen($$$)
foreach my $device ( @$camList ) { foreach my $device ( @$camList ) {
if ( $device->{network_id} eq $network ) { if ( $device->{network_id} eq $network ) {
my $active = "disabled"; my $active = "disabled";
if ( defined( $device->{enabled} ) ) {
$active = "armed" if ( $device->{enabled} == 1 );
$active = "armed" if ( $device->{enabled} eq "true" ); $active = "armed" if ( $device->{enabled} eq "true" );
# $active = "armed" if ( $device->{enabled} ); # $active = "armed" if ( $device->{enabled} );
}
$readUpdates->{"networkCamera".$device->{id}} = $device->{name}.":".$active; $readUpdates->{"networkCamera".$device->{id}} = $device->{name}.":".$active;
$readUpdates->{"networkCamera".$device->{id}."Name"} = $device->{name}; $readUpdates->{"networkCamera".$device->{id}."Name"} = $device->{name};
@ -1507,8 +1509,11 @@ sub BlinkCamera_ParseHomescreen($$$)
foreach my $device ( @$owlList ) { foreach my $device ( @$owlList ) {
if ( $device->{network_id} eq $network ) { if ( $device->{network_id} eq $network ) {
my $active = "disabled"; my $active = "disabled";
if ( defined( $device->{enabled} ) ) {
$active = "armed" if ( $device->{enabled} == 1 );
$active = "armed" if ( $device->{enabled} eq "true" ); $active = "armed" if ( $device->{enabled} eq "true" );
# $active = "armed" if ( $device->{enabled} ); # $active = "armed" if ( $device->{enabled} );
}
$readUpdates->{"networkCamera".$device->{id}} = $device->{name}.":".$active; $readUpdates->{"networkCamera".$device->{id}} = $device->{name}.":".$active;
$readUpdates->{"networkCamera".$device->{id}."Name"} = $device->{name}; $readUpdates->{"networkCamera".$device->{id}."Name"} = $device->{name};