Add "bypass age verification" switch to NextDNS integration (#150716)

This commit is contained in:
Maciej Bieniek
2025-08-15 20:46:06 +02:00
committed by GitHub
parent d5970e7733
commit 078b7224fc
3 changed files with 57 additions and 0 deletions

View File

@@ -328,6 +328,9 @@
"block_zoom": { "block_zoom": {
"name": "Block Zoom" "name": "Block Zoom"
}, },
"bypass_age_verification": {
"name": "Bypass age verification"
},
"cache_boost": { "cache_boost": {
"name": "Cache boost" "name": "Cache boost"
}, },

View File

@@ -56,6 +56,12 @@ SWITCHES = (
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
state=lambda data: data.anonymized_ecs, state=lambda data: data.anonymized_ecs,
), ),
NextDnsSwitchEntityDescription(
key="bav",
translation_key="bypass_age_verification",
entity_category=EntityCategory.CONFIG,
state=lambda data: data.bav,
),
NextDnsSwitchEntityDescription( NextDnsSwitchEntityDescription(
key="logs", key="logs",
translation_key="logs", translation_key="logs",

View File

@@ -2879,6 +2879,54 @@
'state': 'on', 'state': 'on',
}) })
# --- # ---
# name: test_switch[switch.fake_profile_bypass_age_verification-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.fake_profile_bypass_age_verification',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Bypass age verification',
'platform': 'nextdns',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'bypass_age_verification',
'unique_id': 'xyz12_bav',
'unit_of_measurement': None,
})
# ---
# name: test_switch[switch.fake_profile_bypass_age_verification-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Fake Profile Bypass age verification',
}),
'context': <ANY>,
'entity_id': 'switch.fake_profile_bypass_age_verification',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switch[switch.fake_profile_cache_boost-entry] # name: test_switch[switch.fake_profile_cache_boost-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({