debug rdc_chambre_eclairage maintenant fonctionnel ... ou pas
This commit is contained in:
		@@ -24,20 +24,26 @@ class rdc_chambre_eclairage extends hook
 | 
			
		||||
	{
 | 
			
		||||
		global $devices, $indexDevices;
 | 
			
		||||
		logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
 | 
			
		||||
		$lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"];
 | 
			
		||||
		$lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"]["value"];
 | 
			
		||||
		$targetAmbiance = $indexDevices[RDC_CHAMBRE_AMBIANCE];
 | 
			
		||||
		$targetEclairage = $indexDevices[RDC_CHAMBRE_ECLAIRAGE];
 | 
			
		||||
		if ($property == "occupancy")
 | 
			
		||||
		{
 | 
			
		||||
			if ($value == ON and $lux < 150)
 | 
			
		||||
			logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
			logger(DEBUG, "lux = " . bool2string($lux) . " luminance_min = " . $this->luminance_min, __FILE__ . ":" . __LINE__);
 | 
			
		||||
 | 
			
		||||
			if ($value === true and $lux < $this->luminance_min)
 | 
			
		||||
			{
 | 
			
		||||
				logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
				logger(DEBUG, _("lux < luminance_min"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
				if ($targetAmbiance->properties["state"]["method"] == MANUAL)
 | 
			
		||||
				{
 | 
			
		||||
				logger(DEBUG, _("method  => MANUAL"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
 | 
			
		||||
					$method = false;
 | 
			
		||||
					$delayState = false;
 | 
			
		||||
				}else
 | 
			
		||||
				{
 | 
			
		||||
				logger(DEBUG, _("method => AUTO"), __FILE__ . ":" . __LINE__);
 | 
			
		||||
					$method = AUTO;
 | 
			
		||||
					$delayState = "OFF";
 | 
			
		||||
				}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user