Bump NextDNS backend library (#76300)

* Bump NextDNS backend library

* Update tests

* Update diagnostics tests

* Use fixtures
pull/76483/head
Maciej Bieniek 2022-08-08 16:52:36 +02:00 committed by GitHub
parent f67a45f643
commit 9f240d5bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 120 additions and 3 deletions

View File

@ -13,6 +13,7 @@ from .const import (
ATTR_ENCRYPTION,
ATTR_IP_VERSIONS,
ATTR_PROTOCOLS,
ATTR_SETTINGS,
ATTR_STATUS,
CONF_PROFILE_ID,
DOMAIN,
@ -31,6 +32,7 @@ async def async_get_config_entry_diagnostics(
encryption_coordinator = coordinators[ATTR_ENCRYPTION]
ip_versions_coordinator = coordinators[ATTR_IP_VERSIONS]
protocols_coordinator = coordinators[ATTR_PROTOCOLS]
settings_coordinator = coordinators[ATTR_SETTINGS]
status_coordinator = coordinators[ATTR_STATUS]
diagnostics_data = {
@ -39,6 +41,7 @@ async def async_get_config_entry_diagnostics(
"encryption_coordinator_data": asdict(encryption_coordinator.data),
"ip_versions_coordinator_data": asdict(ip_versions_coordinator.data),
"protocols_coordinator_data": asdict(protocols_coordinator.data),
"settings_coordinator_data": asdict(settings_coordinator.data),
"status_coordinator_data": asdict(status_coordinator.data),
}

View File

@ -3,7 +3,7 @@
"name": "NextDNS",
"documentation": "https://www.home-assistant.io/integrations/nextdns",
"codeowners": ["@bieniu"],
"requirements": ["nextdns==1.0.2"],
"requirements": ["nextdns==1.1.0"],
"config_flow": true,
"iot_class": "cloud_polling",
"loggers": ["nextdns"]

View File

@ -1106,7 +1106,7 @@ nextcloudmonitor==1.1.0
nextcord==2.0.0a8
# homeassistant.components.nextdns
nextdns==1.0.2
nextdns==1.1.0
# homeassistant.components.niko_home_control
niko-home-control==0.2.1

View File

@ -787,7 +787,7 @@ nexia==2.0.2
nextcord==2.0.0a8
# homeassistant.components.nextdns
nextdns==1.0.2
nextdns==1.1.0
# homeassistant.components.nfandroidtv
notifications-android-tv==0.1.5

View File

@ -54,6 +54,48 @@ SETTINGS = Settings(
typosquatting_protection=True,
web3=True,
youtube_restricted_mode=False,
block_9gag=True,
block_amazon=True,
block_blizzard=True,
block_dailymotion=True,
block_discord=True,
block_disneyplus=True,
block_ebay=True,
block_facebook=True,
block_fortnite=True,
block_hulu=True,
block_imgur=True,
block_instagram=True,
block_leagueoflegends=True,
block_messenger=True,
block_minecraft=True,
block_netflix=True,
block_pinterest=True,
block_primevideo=True,
block_reddit=True,
block_roblox=True,
block_signal=True,
block_skype=True,
block_snapchat=True,
block_spotify=True,
block_steam=True,
block_telegram=True,
block_tiktok=True,
block_tinder=True,
block_tumblr=True,
block_twitch=True,
block_twitter=True,
block_vimeo=True,
block_vk=True,
block_whatsapp=True,
block_xboxlive=True,
block_youtube=True,
block_zoom=True,
block_dating=True,
block_gambling=True,
block_piracy=True,
block_porn=True,
block_social_networks=True,
)

View File

@ -0,0 +1,67 @@
{
"block_page": false,
"cache_boost": true,
"cname_flattening": true,
"anonymized_ecs": true,
"logs": true,
"web3": true,
"allow_affiliate": true,
"block_disguised_trackers": true,
"ai_threat_detection": true,
"block_csam": true,
"block_ddns": true,
"block_nrd": true,
"block_parked_domains": true,
"cryptojacking_protection": true,
"dga_protection": true,
"dns_rebinding_protection": true,
"google_safe_browsing": false,
"idn_homograph_attacks_protection": true,
"threat_intelligence_feeds": true,
"typosquatting_protection": true,
"block_bypass_methods": true,
"safesearch": false,
"youtube_restricted_mode": false,
"block_9gag": true,
"block_amazon": true,
"block_blizzard": true,
"block_dailymotion": true,
"block_discord": true,
"block_disneyplus": true,
"block_ebay": true,
"block_facebook": true,
"block_fortnite": true,
"block_hulu": true,
"block_imgur": true,
"block_instagram": true,
"block_leagueoflegends": true,
"block_messenger": true,
"block_minecraft": true,
"block_netflix": true,
"block_pinterest": true,
"block_primevideo": true,
"block_reddit": true,
"block_roblox": true,
"block_signal": true,
"block_skype": true,
"block_snapchat": true,
"block_spotify": true,
"block_steam": true,
"block_telegram": true,
"block_tiktok": true,
"block_tinder": true,
"block_tumblr": true,
"block_twitch": true,
"block_twitter": true,
"block_vimeo": true,
"block_vk": true,
"block_whatsapp": true,
"block_xboxlive": true,
"block_youtube": true,
"block_zoom": true,
"block_dating": true,
"block_gambling": true,
"block_piracy": true,
"block_porn": true,
"block_social_networks": true
}

View File

@ -1,11 +1,13 @@
"""Test NextDNS diagnostics."""
from collections.abc import Awaitable, Callable
import json
from aiohttp import ClientSession
from homeassistant.components.diagnostics import REDACTED
from homeassistant.core import HomeAssistant
from tests.common import load_fixture
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.components.nextdns import init_integration
@ -14,6 +16,8 @@ async def test_entry_diagnostics(
hass: HomeAssistant, hass_client: Callable[..., Awaitable[ClientSession]]
) -> None:
"""Test config entry diagnostics."""
settings = json.loads(load_fixture("settings.json", "nextdns"))
entry = await init_integration(hass)
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
@ -60,6 +64,7 @@ async def test_entry_diagnostics(
"tcp_queries_ratio": 0.0,
"udp_queries_ratio": 40.0,
}
assert result["settings_coordinator_data"] == settings
assert result["status_coordinator_data"] == {
"all_queries": 100,
"allowed_queries": 30,