Fallback Fix
This commit is contained in:
		@@ -13,7 +13,7 @@ class FallbackManager
 | 
			
		||||
 | 
			
		||||
	function check(){
 | 
			
		||||
		//TODO: FIX IT
 | 
			
		||||
		/*$allDevicesData = DeviceManager::getAllDevices();
 | 
			
		||||
		$allDevicesData = DeviceManager::getAllDevices();
 | 
			
		||||
		foreach ($allDevicesData as $deviceKey => $deviceValue) {
 | 
			
		||||
			$allSubDevicesData = SubDeviceManager::getAllSubDevices($deviceValue['device_id']);
 | 
			
		||||
			foreach ($allSubDevicesData as $subDeviceKey => $subDeviceValue) {
 | 
			
		||||
@@ -22,12 +22,15 @@ class FallbackManager
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				$lastRecord = RecordManager::getLastRecord($subDeviceValue['subdevice_id']);
 | 
			
		||||
				$minutes = (time() - $lastRecord['time']) / 60;
 | 
			
		||||
				echo $minutes;
 | 
			
		||||
				if ( $minutes > 2){
 | 
			
		||||
				if ($lastRecord["value"] == $this->deviceDefinitions[$subDeviceValue['type']]["fallBack"]) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				$minutes = (strtotime($lastRecord['time']) - time()) / 60;
 | 
			
		||||
				if ( $minutes > 3){
 | 
			
		||||
					RecordManager::create($deviceValue['device_id'], $subDeviceValue['type'], $this->deviceDefinitions[$subDeviceValue['type']]["fallBack"]);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}*/
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user