Sonoff basic, s20 firmware update

This commit is contained in:
JonatanRek
2019-08-23 23:03:55 +02:00
parent f089205dc0
commit 4a87204e16
3 changed files with 37 additions and 43 deletions

20
api.php
View File

@@ -15,16 +15,16 @@ foreach (["class", "views"] as $dir) {
Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
//Filtrování IP adress
if (DEBUGMOD != 1) {
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
echo json_encode(array(
'state' => 'unsuccess',
'errorMSG' => "Using API from your IP insn´t alowed!",
));
header("HTTP/1.1 401 Unauthorized");
exit();
}
/*if (DEBUGMOD != 1) {
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
echo json_encode(array(
'state' => 'unsuccess',
'errorMSG' => "Using API from your IP insn´t alowed!",
));
header("HTTP/1.1 401 Unauthorized");
exit();
}
}*/
@@ -41,7 +41,7 @@ if (isset($obj['user']) && $obj['user'] != ''){
}
//automationExecution
AutomationManager::executeAll();
//AutomationManager::executeAll();
//Record Cleaning
RecordManager::clean(RECORDTIMOUT);