1
0

some debbuging

This commit is contained in:
2022-01-02 18:14:13 +01:00
parent 2e6b2fe5cb
commit d79463fbd4
11 changed files with 147 additions and 242 deletions

View File

@ -4,15 +4,13 @@
define( "EOL", "\n");
define("Z2M", "zigbee2mqtt");
declare(ticks = 1);
$listProperties = array("powerSource" => "batterie");
$listPropertiesKeys = array("property");
include "class/main.php";
require "class/main.php";
//global variables
$topics = array(); // list of topics
@ -36,25 +34,28 @@ $topics["zigbee2mqtt"] = new topic;
bindtextdomain("moha", "./locale");
textdomain("moha");
if (!init()) exit(1);
require "mqtt_functions.php";
require "utils.php";
require "events.php";
require "db_functions.php";
if (!init()) exit(1);
$client = new Mosquitto\Client();
// log levels
define( "DEBUG", $client->LOG_DEBUG);
define( "INFO", $client->LOG_INFO);
define( "NOTICE", $client->LOG_NOTICE);
define( "WARNING", $client->LOG_WARNING);
define( "ERROR", $client->LOG_ERR);
define( "DEBUG", $client::LOG_DEBUG);
define( "INFO", $client::LOG_INFO);
define( "NOTICE", $client::LOG_NOTICE);
define( "WARNING", $client::LOG_WARNING);
define( "ERROR", $client::LOG_ERR);
define( "ALL", DEBUG | INFO | NOTICE | WARNING | ERROR);
$logLevel = DEBUG;
$notificationLevel = WARNING | ERROR;
require "utils.php";
require "mqtt_functions.php";
require "events.php";
require "db_functions.php";
require "class/availability.php";
// defining callback functions
$client->onConnect('connectResponse');
$client->onDisconnect('disconnectResponse');