2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

30_HUEBridge.pm: changed noshutdown default due to problems with latest bridge firmware

git-svn-id: https://svn.fhem.de/fhem/trunk@16135 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2018-02-09 14:49:25 +00:00
parent 19be7a3fba
commit 58c7de6269

View File

@ -371,8 +371,6 @@ sub HUEBridge_fillBridgeInfo($$)
$attr{$name}{icon} = 'hue_filled_bridge_v1' if( $hash->{modelid} && $hash->{modelid} eq 'BSB001' );
$attr{$name}{icon} = 'hue_filled_bridge_v2' if( $hash->{modelid} && $hash->{modelid} eq 'BSB002' );
}
$hash->{noshutdown} = AttrVal($name,'noshutdown', $hash->{name} =~ /deCONZ-GW|RaspBee/i)?1:0 if( !defined($hash->{noshutdown} ) );
}
sub
@ -397,10 +395,6 @@ HUEBridge_OpenDev($)
$hash->{modelName} = $1;
$ret =~ m/<manufacturer>([^<]*)/;
$hash->{manufacturer} = $1;
if( $hash->{manufacturer} =~ /dresden elektronik/i ) {
$hash->{noshutdown} = AttrVal($name, 'noshutdown', 1)?1:0;
}
}
my $result = HUEBridge_Call($hash, undef, 'config', undef);
@ -1407,7 +1401,7 @@ HUEBridge_HTTP_Call($$$;$)
}
#Log3 $name, 3, "Url: " . $uri;
Log3 $name, 4, "using HUEBridge_HTTP_Request: $method ". ($path?$path:'');
my $ret = HUEBridge_HTTP_Request(0,$uri,$method,undef,$obj,$hash->{noshutdown});
my $ret = HUEBridge_HTTP_Request(0,$uri,$method,undef,$obj,AttrVal($name,'noshutdown', 1));
#Log3 $name, 3, Dumper $ret;
if( !defined($ret) ) {
return undef;
@ -1473,7 +1467,7 @@ HUEBridge_HTTP_Call2($$$$;$)
url => $url,
timeout => 4,
method => $method,
noshutdown => $hash->{noshutdown},
noshutdown => AttrVal($name,'noshutdown', 1),
header => "Content-Type: application/json",
data => $obj,
});
@ -1503,7 +1497,7 @@ HUEBridge_HTTP_Call2($$$$;$)
url => $url,
timeout => 10,
method => $method,
noshutdown => $hash->{noshutdown},
noshutdown => AttrVal($name,'noshutdown', 1),
header => "Content-Type: application/json",
data => $obj,
hash => $hash,
@ -1780,19 +1774,6 @@ HUEBridge_Attr($$$)
readingsSingleUpdate($hash, 'state', IsDisabled($name)?'disabled':'active', 1 );
HUEBridge_OpenDev($hash) if( !IsDisabled($name) );
} elsif( $attrName eq "noshutdown" ) {
my $hash = $defs{$name};
if( $cmd eq 'set' ) {
$hash->{noshutdown} = $attrVal;
} else {
if( defined($hash->{manufacturer}) ) {
$hash->{noshutdown} = ($hash->{manufacturer} =~ /dresden elektronik/i)?1:0;
} else {
$hash->{noshutdown} = ($hash->{name} =~ /deCONZ-GW|RaspBee/i)?1:0;
}
}
}
@ -1950,9 +1931,7 @@ HUEBridge_Attr($$$)
the bridge will request the real device state after a set command. default is 1.</li>
<li>noshutdown<br>
Some bridge devcies require a different type of connection handling. raspbee/deconz only works if the connection
is not immediately closed, the phillips hue bridge works better if the connection is immediately closed. This module
tries to autodetect the bridge device type. the type of connection handling can be seen in the noshutdown internal
and can be overwritten with the noshutdown attribute.</li>
is not immediately closed, the phillips hue bridge now shows the same behavior. so this is now the default. </li>
</ul><br>
</ul><br>