feat: upload alarm snapshots to webhook payloads

This commit is contained in:
2026-06-09 13:01:15 +08:00
parent 523f928303
commit 04729a0fd1
14 changed files with 853 additions and 23 deletions

View File

@@ -128,6 +128,12 @@ zone_ids = ["1", "2", "3"]
save_config_document(
path,
{
"alarm_snapshot_upload": {
"enabled": True,
"service_url": "https://ota.zhengxinshipin.com",
"secret": "change-me-in-production",
"object_key_prefix": "cold-display/alarms",
},
"webhooks": {
"enabled": True,
"event_url": "https://example.com/events",
@@ -146,6 +152,10 @@ zone_ids = ["1", "2", "3"]
)
text = path.read_text(encoding="utf-8")
self.assertIn("[alarm_snapshot_upload]", text)
self.assertIn('service_url = "https://ota.zhengxinshipin.com"', text)
self.assertIn('secret = "change-me-in-production"', text)
self.assertIn('object_key_prefix = "cold-display/alarms"', text)
self.assertIn("[webhooks]", text)
self.assertIn('event_url = "https://example.com/events"', text)
self.assertIn('case_url = "https://example.com/cases"', text)