Skip to content

Commit af9da32

Browse files
committedAug 4, 2023
Completely remove lights status
1 parent 557169f commit af9da32

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed
 

‎commands/StatusCommand.php

-12
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,6 @@ private static function formatDoorStatus($url) {
9595
return 'Door: ' . htmlspecialchars($data['latch']) . ' and ' . htmlspecialchars($data['door']);
9696
}
9797

98-
private static function formatLightsStatus($url) {
99-
try {
100-
$data = static::getJson($url);
101-
}
102-
catch (Exception $e) {
103-
return 'Lights status not available: ' . $e->getMessage();
104-
}
105-
106-
return 'Lights: ' . htmlspecialchars($data['status']) . ', policy: ' . htmlspecialchars($data['policy']);
107-
}
108-
10998
private static function formatUsers($url) {
11099
try {
111100
$data = static::getJson($url);
@@ -251,7 +240,6 @@ private static function formatMusic($url) {
251240
private static function getStatus(array $config) {
252241
return
253242
static::formatDoorStatus($config['door_url']) . PHP_EOL .
254-
//static::formatLightsStatus($config['lights_url']) . PHP_EOL .
255243
static::formatMqttStatus($config['mqtt']) . PHP_EOL .
256244
static::formatMusic($config['music_url']) . PHP_EOL .
257245
static::formatUsers($config['users_url']);

‎config/settings.example.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
]]);
2525

2626
define('STATUS_DOOR_URL', 'https://example.com/door/status.json');
27-
define('STATUS_LIGHTS_URL', 'https://example.com/lights/status.json');
2827
define('STATUS_MQTT', [
2928
'url' => 'http://example.com/status',
3029
'timeout' => 20,

‎public/hook.php

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252

5353
$telegram->setCommandConfig('status', [
5454
'door_url' => STATUS_DOOR_URL,
55-
'lights_url' => STATUS_LIGHTS_URL,
5655
'mqtt' => STATUS_MQTT,
5756
'music_url' => STATUS_MUSIC_URL,
5857
'users_url' => STATUS_USERS_URL,

0 commit comments

Comments
 (0)
Please sign in to comment.