a lot of bugs corrected\nrdc_wc_eclairage
This commit is contained in:
		@@ -17,10 +17,10 @@ class rdc_sdb_eclairage extends hook
 | 
			
		||||
	// devicelist[$ieeAddress][0] => property to watch
 | 
			
		||||
	// devicelist[$ieeAddress][1] => initialized = true
 | 
			
		||||
	protected $devicelist = array(
 | 
			
		||||
		//RDC_SDB_DOUCHE_MVMT => array("occupancy", false),
 | 
			
		||||
		RDC_SDB_PLAFOND_MVMT => array("occupancy", false),
 | 
			
		||||
		RDC_SDB_MVMT => array("occupancy", false),
 | 
			
		||||
		RDC_SDB_WC_ECLAIRAGE => array("state_l1", false)
 | 
			
		||||
		RDC_SDB_DOUCHE_MVMT => "occupancy",
 | 
			
		||||
		RDC_SDB_PLAFOND_MVMT => "occupancy",
 | 
			
		||||
		RDC_SDB_MVMT => "occupancy",
 | 
			
		||||
		RDC_SDB_WC_ECLAIRAGE => "state_l1"
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	// callback fonction. Is called with these 3 parameters
 | 
			
		||||
@@ -29,10 +29,11 @@ class rdc_sdb_eclairage extends hook
 | 
			
		||||
		global $indexDevices;
 | 
			
		||||
		//var_dump($value);
 | 
			
		||||
		$deviceTarget = $indexDevices[RDC_SDB_WC_ECLAIRAGE];
 | 
			
		||||
 | 
			
		||||
		logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
 | 
			
		||||
		switch($property)
 | 
			
		||||
		{
 | 
			
		||||
			case "occupancy":
 | 
			
		||||
				logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
				if ($value == ON)
 | 
			
		||||
				{
 | 
			
		||||
					if (getValue($deviceTarget->ieeeAddress, "state_l1") != "ON")
 | 
			
		||||
@@ -44,6 +45,7 @@ class rdc_sdb_eclairage extends hook
 | 
			
		||||
				}
 | 
			
		||||
				break;
 | 
			
		||||
			case "state_l1":
 | 
			
		||||
				logger(DEBUG, _("CASE: state_l1"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
				if ($value == "ON")
 | 
			
		||||
				{
 | 
			
		||||
					setDelay($deviceTarget, $this->delay, $this->timeUnit, "state_l1", "OFF", true);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user