From 801e26dda98fa0a65dc8b684409793756cf9f4e7 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Mon, 16 Mar 2020 15:03:43 +0100 Subject: [PATCH] Updater Log Message + api tweeks --- api.php | 2 +- update.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index 4416c9e..438ec6e 100644 --- a/api.php +++ b/api.php @@ -288,7 +288,7 @@ if ($values != null && $values != "") { $subDeviceLastReordValue = $subDeviceLastReord['value']; if ($subDeviceLastReord['execuded'] == 0){ - $logManager->write("[API] subDevice_ID ".$subDeviceId . " executed comand with value " .$subDeviceLastReordValue . " record id " . $subDeviceLastReord['record_id'] . " executed " . $subDeviceLastReord['execuded']); + $logManager->write("[API] subDevice_ID ".$subDeviceId . " executed comand with value " .$subDeviceLastReordValue . " record id " . $subDeviceLastReord['record_id'] . " executed " . $subDeviceLastReord['execuded'], LogRecordType::INFO); RecordManager::setExecuted($subDeviceLastReord['record_id']); } diff --git a/update.php b/update.php index cecc76a..0fb3acb 100644 --- a/update.php +++ b/update.php @@ -61,8 +61,14 @@ if (file_exists($localBinary)) { $logManager->write("[Updater] version PHP: " . md5_file($localBinary), LogRecordType::INFO); if ($_SERVER['HTTP_X_ESP8266_SKETCH_MD5'] != md5_file($localBinary)) { sendFile($localBinary); + //get device data + $device = DeviceManager::getDeviceByMac($macAddress); + $deviceName = $device['name']; + $deviceId = $device['device_id']; + //logfile write + $logManager->write("[Device] device_ID " . $deviceId . "was just updated to new version", LogRecordType::WARNING); + $logManager->write("[Device] version hash:" . md5_file($localBinary), LogRecordType::INFO); //notification - $deviceName = DeviceManager::getDeviceByMac($macAddress)['name']; $notificationMng = new NotificationManager; $notificationData = [ 'title' => 'Info',