Initial commit
Some checks failed
🧪 Integration Testing / 🔧 Test Integration (2023.12.0, 3.11) (push) Successful in 2m11s
🧪 Integration Testing / 🔧 Test Integration (2023.12.0, 3.12) (push) Successful in 2m2s
🧪 Integration Testing / 🔧 Test Integration (2024.1.0, 3.11) (push) Successful in 1m4s
🧪 Integration Testing / 🔧 Test Integration (2024.1.0, 3.12) (push) Successful in 1m19s
🛡️ Code Quality & Security Check / 🔍 Code Quality Analysis (push) Failing after 56s
Some checks failed
🧪 Integration Testing / 🔧 Test Integration (2023.12.0, 3.11) (push) Successful in 2m11s
🧪 Integration Testing / 🔧 Test Integration (2023.12.0, 3.12) (push) Successful in 2m2s
🧪 Integration Testing / 🔧 Test Integration (2024.1.0, 3.11) (push) Successful in 1m4s
🧪 Integration Testing / 🔧 Test Integration (2024.1.0, 3.12) (push) Successful in 1m19s
🛡️ Code Quality & Security Check / 🔍 Code Quality Analysis (push) Failing after 56s
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
92
custom_components/adguard_hub/const.py
Normal file
92
custom_components/adguard_hub/const.py
Normal file
@@ -0,0 +1,92 @@
|
||||
"""Constants for the AdGuard Control Hub integration."""
|
||||
from typing import Final
|
||||
|
||||
DOMAIN: Final = "adguard_hub"
|
||||
MANUFACTURER: 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",
|
||||
"blocked_services_get": "/control/blocked_services/get",
|
||||
"blocked_services_update": "/control/blocked_services/update",
|
||||
"protection": "/control/protection",
|
||||
"stats": "/control/stats",
|
||||
}
|
||||
|
||||
# Available blocked services with friendly names
|
||||
BLOCKED_SERVICES: Final = {
|
||||
# Social Media
|
||||
"youtube": "YouTube",
|
||||
"facebook": "Facebook",
|
||||
"instagram": "Instagram",
|
||||
"tiktok": "TikTok",
|
||||
"twitter": "Twitter/X",
|
||||
"snapchat": "Snapchat",
|
||||
"reddit": "Reddit",
|
||||
|
||||
# Entertainment
|
||||
"netflix": "Netflix",
|
||||
"disney_plus": "Disney+",
|
||||
"spotify": "Spotify",
|
||||
"twitch": "Twitch",
|
||||
|
||||
# Gaming
|
||||
"gaming": "Gaming Services",
|
||||
"steam": "Steam",
|
||||
"epic_games": "Epic Games",
|
||||
"roblox": "Roblox",
|
||||
|
||||
# Shopping
|
||||
"amazon": "Amazon",
|
||||
"ebay": "eBay",
|
||||
|
||||
# Communication
|
||||
"whatsapp": "WhatsApp",
|
||||
"telegram": "Telegram",
|
||||
"discord": "Discord",
|
||||
|
||||
# Other
|
||||
"adult": "Adult Content",
|
||||
"gambling": "Gambling Sites",
|
||||
"torrents": "Torrent Sites",
|
||||
}
|
||||
|
||||
# Service attributes
|
||||
ATTR_CLIENT_NAME: Final = "client_name"
|
||||
ATTR_SERVICES: Final = "services"
|
||||
ATTR_DURATION: Final = "duration"
|
||||
ATTR_CLIENTS: Final = "clients"
|
||||
ATTR_CLIENT_PATTERN: Final = "client_pattern"
|
||||
ATTR_SETTINGS: Final = "settings"
|
||||
|
||||
# Icons
|
||||
ICON_HUB: Final = "mdi:router-network"
|
||||
ICON_PROTECTION: Final = "mdi:shield"
|
||||
ICON_PROTECTION_OFF: Final = "mdi:shield-off"
|
||||
ICON_CLIENT: Final = "mdi:devices"
|
||||
ICON_CLIENT_OFFLINE: Final = "mdi:devices-off"
|
||||
ICON_BLOCKED_SERVICE: Final = "mdi:block-helper"
|
||||
ICON_ALLOWED_SERVICE: Final = "mdi:check-circle"
|
||||
ICON_STATISTICS: Final = "mdi:chart-line"
|
Reference in New Issue
Block a user