From a80388a4e3986a90cfe9a4cb67ed00a58d1f073a Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Sun, 30 Jun 2013 22:57:48 +0000 Subject: [PATCH] allow more than one bridge git-svn-id: https://svn.fhem.de/fhem/trunk@3375 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/30_HUEBridge.pm | 1 + fhem/FHEM/31_HUEDevice.pm | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index f99992aa3..faa1e53af 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII - SVN + - feature: HUEDevice: support more than one bridge - feature: updateInBackground global attribute - feature: SYSSTAT: allow stateFormat - feature: Module 70_VIERA supports now module 95_remotecontrol with own diff --git a/fhem/FHEM/30_HUEBridge.pm b/fhem/FHEM/30_HUEBridge.pm index 0667ffb90..e0e7a236f 100644 --- a/fhem/FHEM/30_HUEBridge.pm +++ b/fhem/FHEM/30_HUEBridge.pm @@ -473,6 +473,7 @@ HUEBridge_HTTP_Request($$$@) diff --git a/fhem/FHEM/31_HUEDevice.pm b/fhem/FHEM/31_HUEDevice.pm index 4a36660e4..0a0e48df2 100644 --- a/fhem/FHEM/31_HUEDevice.pm +++ b/fhem/FHEM/31_HUEDevice.pm @@ -152,7 +152,9 @@ sub HUEDevice_Define($$) $hash->{STATE} = 'Initialized'; $hash->{fhem}{interfaces}= "dimmer"; + $hash->{ID} = $id; $hash->{fhem}{id} = $id; + $hash->{INTERVAL} = $interval; $hash->{fhem}{on} = -1; @@ -329,7 +331,7 @@ HUEDevice_Set($@) if( scalar keys %obj ) { - my $result = HUEDevice_ReadFromServer($hash,$hash->{fhem}{id}."/state",\%obj); + my $result = HUEDevice_ReadFromServer($hash,$hash->{ID}."/state",\%obj); if( $result->{'error'} ) { $hash->{STATE} = $result->{'error'}->{'description'}; return undef; @@ -528,7 +530,7 @@ HUEDevice_GetUpdate($) InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEDevice_GetUpdate", $hash, 1); } - my $result = HUEDevice_ReadFromServer($hash,$hash->{fhem}{id}); + my $result = HUEDevice_ReadFromServer($hash,$hash->{ID}); if( !defined($result) ) { $hash->{STATE} = "unknown"; return;