allow starting of bridge firmware update
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3181 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII
|
||||
- SVN
|
||||
- feature: HUEBridge: allow starting of bridge firmware update
|
||||
- change: EnOcean: profil PM101 changed, old profiles FAH, FBH, FTF, SR04 removed
|
||||
- feature: TCM: new attr blockSenderID:
|
||||
Block receiving telegrams with a TCM SenderID sent by repeaters
|
||||
|
||||
@@ -149,8 +149,23 @@ HUEBridge_Set($@)
|
||||
RemoveInternalTimer($hash);
|
||||
HUEBridge_GetUpdate($hash);
|
||||
return undef;
|
||||
} elsif($cmd eq 'swupdate') {
|
||||
my $obj = {
|
||||
'swupdate' => { 'updatestate' => 3, },
|
||||
};
|
||||
my $result = HUEBridge_Call($hash, 'config', $obj);
|
||||
|
||||
if( !defined($result) || $result->{'error'} ) {
|
||||
return $result->{'error'}->{'description'};
|
||||
}
|
||||
|
||||
$hash->{updatestate} = 3;
|
||||
$hash->{STATE} = "updating";
|
||||
return "starting update";
|
||||
} else {
|
||||
return "Unknown argument $cmd, choose one of statusRequest";
|
||||
my $list = "statusRequest";
|
||||
$list .= " swupdate" if( defined($hash->{updatestate}) && $hash->{updatestate} == 2 );
|
||||
return "Unknown argument $cmd, choose one of $list";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +206,10 @@ HUEBridge_GetUpdate($)
|
||||
|
||||
if( defined( $result->{swupdate} ) ) {
|
||||
my $txt = $result->{swupdate}->{text};
|
||||
readingsSingleUpdate($hash, "swupdate", $txt, defined($hash->{LOCAL} ? 0 : 1)) if( $txt ne ReadingsVal($name,"swupdate","") );
|
||||
readingsSingleUpdate($hash, "swupdate", $txt, defined($hash->{LOCAL} ? 0 : 1)) if( $txt && $txt ne ReadingsVal($name,"swupdate","") );
|
||||
$hash->{STATE} = "update done" if( $result->{swupdate}->{updatestate} == 0 && $hash->{updatestate} >= 2 );
|
||||
$hash->{STATE} = "update failed" if( $result->{swupdate}->{updatestate} == 2 && $hash->{updatestate} == 3 );
|
||||
|
||||
$hash->{updatestate} = $result->{swupdate}->{updatestate};
|
||||
} elsif ( defined( $hash->{swupdate} ) ) {
|
||||
delete( $hash->{updatestate} );
|
||||
@@ -419,7 +437,7 @@ HUEBridge_HTTP_Request($$$@)
|
||||
$ret=~ s/(.*?)\r\n\r\n//s; # Not greedy: switch off the header.
|
||||
my @header= split("\r\n", $1);
|
||||
my $hostpath= $quiet ? "<hidden>" : $host . $path;
|
||||
Log 4, "HUEBridge_HTTP_Request $displayurl: Got data, length: ".length($ret);
|
||||
Log 5, "HUEBridge_HTTP_Request $displayurl: Got data, length: ".length($ret);
|
||||
if(!length($ret)) {
|
||||
Log 4, "HUEBridge_HTTP_Request $displayurl: Zero length data, header follows...";
|
||||
for (@header) {
|
||||
@@ -489,6 +507,8 @@ HUEBridge_HTTP_Request($$$@)
|
||||
<ul>
|
||||
<li>statusRequest<br>
|
||||
Update bridge status.</li>
|
||||
<li>swupdate<br>
|
||||
Update bridge status.</li>
|
||||
</ul><br>
|
||||
</ul><br>
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ sub HUEDevice_Define($$)
|
||||
$hash->{fhem}{xy} = '';
|
||||
|
||||
|
||||
$attr{$name}{devStateIcon} = '{CommandGet("","'.$name.' devStateIcon")}' if( !defined( $attr{$name}{devStateIcon} ) );
|
||||
$attr{$name}{devStateIcon} = '{(CommandGet("","'.$name.' devStateIcon"),"toggle")}' if( !defined( $attr{$name}{devStateIcon} ) );
|
||||
|
||||
AssignIoPort($hash);
|
||||
if(defined($hash->{IODev}->{NAME})) {
|
||||
|
||||
Reference in New Issue
Block a user