97 lines
2.6 KiB
Python
97 lines
2.6 KiB
Python
"""Constants for the AdGuard Control Hub integration."""
|
|
from typing import Final
|
|
|
|
# Integration details
|
|
DOMAIN: Final = "adguard_hub"
|
|
MANUFACTURER: Final = "AdGuard Control Hub"
|
|
INTEGRATION_NAME: Final = "AdGuard Control Hub"
|
|
|
|
# Configuration
|
|
CONF_SSL: Final = "ssl"
|
|
CONF_VERIFY_SSL: Final = "verify_ssl"
|
|
|
|
# Defaults
|
|
DEFAULT_PORT: Final = 3000
|
|
DEFAULT_SSL: Final = False
|
|
DEFAULT_VERIFY_SSL: Final = True
|
|
SCAN_INTERVAL: Final = 30
|
|
|
|
# Platforms
|
|
PLATFORMS: Final = [
|
|
"switch",
|
|
"binary_sensor",
|
|
"sensor",
|
|
]
|
|
|
|
# API Endpoints
|
|
API_ENDPOINTS: Final = {
|
|
"status": "/control/status",
|
|
"clients": "/control/clients",
|
|
"clients_add": "/control/clients/add",
|
|
"clients_update": "/control/clients/update",
|
|
"clients_delete": "/control/clients/delete",
|
|
"blocked_services_all": "/control/blocked_services/all",
|
|
"protection": "/control/protection",
|
|
"stats": "/control/stats",
|
|
"rewrite": "/control/rewrite/list",
|
|
"querylog": "/control/querylog",
|
|
}
|
|
|
|
# Available blocked services (common ones)
|
|
BLOCKED_SERVICES: Final = {
|
|
"youtube": "YouTube",
|
|
"facebook": "Facebook",
|
|
"netflix": "Netflix",
|
|
"gaming": "Gaming Services",
|
|
"instagram": "Instagram",
|
|
"tiktok": "TikTok",
|
|
"twitter": "Twitter/X",
|
|
"snapchat": "Snapchat",
|
|
"reddit": "Reddit",
|
|
"disney_plus": "Disney+",
|
|
"spotify": "Spotify",
|
|
"twitch": "Twitch",
|
|
"steam": "Steam",
|
|
"whatsapp": "WhatsApp",
|
|
"telegram": "Telegram",
|
|
"discord": "Discord",
|
|
"amazon": "Amazon",
|
|
"ebay": "eBay",
|
|
"skype": "Skype",
|
|
"zoom": "Zoom",
|
|
"tinder": "Tinder",
|
|
"pinterest": "Pinterest",
|
|
"linkedin": "LinkedIn",
|
|
"dailymotion": "Dailymotion",
|
|
"vimeo": "Vimeo",
|
|
"viber": "Viber",
|
|
"wechat": "WeChat",
|
|
"ok": "Odnoklassniki",
|
|
"vk": "VKontakte",
|
|
}
|
|
|
|
# Service attributes
|
|
ATTR_CLIENT_NAME: Final = "client_name"
|
|
ATTR_SERVICES: Final = "services"
|
|
ATTR_DURATION: Final = "duration"
|
|
ATTR_CLIENTS: Final = "clients"
|
|
ATTR_ENABLED: Final = "enabled"
|
|
|
|
# Icons
|
|
ICON_PROTECTION: Final = "mdi:shield"
|
|
ICON_PROTECTION_OFF: Final = "mdi:shield-off"
|
|
ICON_CLIENT: Final = "mdi:devices"
|
|
ICON_STATISTICS: Final = "mdi:chart-line"
|
|
ICON_BLOCKED: Final = "mdi:shield-check"
|
|
ICON_QUERIES: Final = "mdi:dns"
|
|
ICON_PERCENTAGE: Final = "mdi:percent"
|
|
ICON_CLIENTS: Final = "mdi:account-multiple"
|
|
|
|
# Service names
|
|
SERVICE_BLOCK_SERVICES: Final = "block_services"
|
|
SERVICE_UNBLOCK_SERVICES: Final = "unblock_services"
|
|
SERVICE_EMERGENCY_UNBLOCK: Final = "emergency_unblock"
|
|
SERVICE_ADD_CLIENT: Final = "add_client"
|
|
SERVICE_REMOVE_CLIENT: Final = "remove_client"
|
|
SERVICE_REFRESH_DATA: Final = "refresh_data"
|