HA 푸시 알림 경로를 정리

This commit is contained in:
seo
2026-06-29 06:02:30 +09:00
parent cd14bb2e5e
commit c5ab60a6e6
7 changed files with 12 additions and 652 deletions
-33
View File
@@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../config/config.php';
$channel = '';
foreach (array_slice($argv, 1) as $arg) {
if (str_starts_with($arg, '--remove=')) {
$channel = trim(substr($arg, 9));
}
}
if ($channel === '') {
fwrite(STDERR, "Usage: php bin/ha_notify_channel.php --remove=control_battery\n");
exit(2);
}
$result = send_ha_notify([
'title' => 'HA 알림 채널 제거',
'message' => 'remove_channel',
'level' => 'info',
'tag' => 'control-channel-remove-' . preg_replace('/[^a-zA-Z0-9_-]+/', '-', $channel),
'data' => [
'channel' => $channel,
'notification_icon' => 'mdi:notification-clear-all',
'persistent' => false,
'sticky' => 'false',
'renotify' => 'false',
],
]);
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
exit(($result['sent'] ?? 0) > 0 ? 0 : 1);