mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +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:
parent
19be7a3fba
commit
58c7de6269
@ -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_v1' if( $hash->{modelid} && $hash->{modelid} eq 'BSB001' );
|
||||||
$attr{$name}{icon} = 'hue_filled_bridge_v2' if( $hash->{modelid} && $hash->{modelid} eq 'BSB002' );
|
$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
|
sub
|
||||||
@ -397,10 +395,6 @@ HUEBridge_OpenDev($)
|
|||||||
$hash->{modelName} = $1;
|
$hash->{modelName} = $1;
|
||||||
$ret =~ m/<manufacturer>([^<]*)/;
|
$ret =~ m/<manufacturer>([^<]*)/;
|
||||||
$hash->{manufacturer} = $1;
|
$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);
|
my $result = HUEBridge_Call($hash, undef, 'config', undef);
|
||||||
@ -1407,7 +1401,7 @@ HUEBridge_HTTP_Call($$$;$)
|
|||||||
}
|
}
|
||||||
#Log3 $name, 3, "Url: " . $uri;
|
#Log3 $name, 3, "Url: " . $uri;
|
||||||
Log3 $name, 4, "using HUEBridge_HTTP_Request: $method ". ($path?$path:'');
|
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;
|
#Log3 $name, 3, Dumper $ret;
|
||||||
if( !defined($ret) ) {
|
if( !defined($ret) ) {
|
||||||
return undef;
|
return undef;
|
||||||
@ -1473,7 +1467,7 @@ HUEBridge_HTTP_Call2($$$$;$)
|
|||||||
url => $url,
|
url => $url,
|
||||||
timeout => 4,
|
timeout => 4,
|
||||||
method => $method,
|
method => $method,
|
||||||
noshutdown => $hash->{noshutdown},
|
noshutdown => AttrVal($name,'noshutdown', 1),
|
||||||
header => "Content-Type: application/json",
|
header => "Content-Type: application/json",
|
||||||
data => $obj,
|
data => $obj,
|
||||||
});
|
});
|
||||||
@ -1503,7 +1497,7 @@ HUEBridge_HTTP_Call2($$$$;$)
|
|||||||
url => $url,
|
url => $url,
|
||||||
timeout => 10,
|
timeout => 10,
|
||||||
method => $method,
|
method => $method,
|
||||||
noshutdown => $hash->{noshutdown},
|
noshutdown => AttrVal($name,'noshutdown', 1),
|
||||||
header => "Content-Type: application/json",
|
header => "Content-Type: application/json",
|
||||||
data => $obj,
|
data => $obj,
|
||||||
hash => $hash,
|
hash => $hash,
|
||||||
@ -1780,19 +1774,6 @@ HUEBridge_Attr($$$)
|
|||||||
|
|
||||||
readingsSingleUpdate($hash, 'state', IsDisabled($name)?'disabled':'active', 1 );
|
readingsSingleUpdate($hash, 'state', IsDisabled($name)?'disabled':'active', 1 );
|
||||||
HUEBridge_OpenDev($hash) if( !IsDisabled($name) );
|
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>
|
the bridge will request the real device state after a set command. default is 1.</li>
|
||||||
<li>noshutdown<br>
|
<li>noshutdown<br>
|
||||||
Some bridge devcies require a different type of connection handling. raspbee/deconz only works if the connection
|
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
|
is not immediately closed, the phillips hue bridge now shows the same behavior. so this is now the default. </li>
|
||||||
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>
|
|
||||||
</ul><br>
|
</ul><br>
|
||||||
</ul><br>
|
</ul><br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user