Event Guard: Remove parameters from event_socket connect() method.

This commit is contained in:
fusionate 2023-09-20 18:50:41 +00:00
parent d9d17a6917
commit d4f7efa4eb
No known key found for this signature in database
1 changed files with 2 additions and 10 deletions

View File

@ -106,17 +106,9 @@
//$ip_address = '10.7.0.253';
//$result = access_allowed($ip_address);
//initialize the settings object
$setting = new settings(["category" => 'switch']);
//set the event socket variables
$event_socket_ip_address = $setting->get('switch','event_socket_ip_address');
$event_socket_port = $setting->get('switch', 'event_socket_port');
$event_socket_password = $setting->get('switch', 'event_socket_password');
//connect to event socket
$socket = new event_socket;
if (!$socket->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
if (!$socket->connect()) {
echo "Unable to connect to event socket\n";
}
@ -152,7 +144,7 @@
//reconnect to event socket
if (!$socket->connected()) {
//echo "Not connected to even socket\n";
if ($socket->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
if ($socket->connect()) {
$cmd = "event json ALL";
$result = $socket->request($cmd);
if ($debug) { print_r($result); }