chart/app/notify/ntfy.py
2026-08-14 02:44:10 -05:00

13 lines
428 B
Python

import httpx
async def send_ntfy(server: str, topic: str, message: str) -> None:
if not topic:
return
async with httpx.AsyncClient(timeout=10) as client:
response = await client.post(
f"{server.rstrip('/')}/{topic}",
content=message,
headers={"Title": "/ESsent", "Priority": "high", "Tags": "chart_with_upwards_trend"},
)
response.raise_for_status()