Add --debug flag to index.php script, restrict foodsi bot query to get only today packages.

This commit is contained in:
Krzysztof Płaczek
2024-12-15 11:10:30 +01:00
parent 13028af1db
commit a98934dfad
3 changed files with 30 additions and 3 deletions

View File

@@ -9,6 +9,10 @@ require_once 'vendor/autoload.php';
date_default_timezone_set('Europe/Warsaw');
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
$_ENV['DEBUG'] = false;
if ($argc === 2 and isset($argv[1]) && $argv[1] === '--debug') {
$_ENV['DEBUG'] = true;
}
$client = new Client();
$homeassistant = new HomeassistantService($client);
$foodsi = new FoodsiService($client);