mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Add new NextDNS switches (#193848)
This commit is contained in:
@@ -189,6 +189,9 @@
|
||||
"block_9gag": {
|
||||
"name": "Block 9GAG"
|
||||
},
|
||||
"block_algorithmically_generated_domains": {
|
||||
"name": "Block algorithmically generated domains"
|
||||
},
|
||||
"block_amazon": {
|
||||
"name": "Block Amazon"
|
||||
},
|
||||
@@ -321,6 +324,9 @@
|
||||
"block_roblox": {
|
||||
"name": "Block Roblox"
|
||||
},
|
||||
"block_rotating_ad_domains": {
|
||||
"name": "Block rotating ad domains"
|
||||
},
|
||||
"block_signal": {
|
||||
"name": "Block Signal"
|
||||
},
|
||||
|
||||
@@ -84,12 +84,24 @@ SWITCHES = (
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
state=lambda data: data.block_disguised_trackers,
|
||||
),
|
||||
NextDnsSwitchEntityDescription(
|
||||
key="block_rotating_ad_domains",
|
||||
translation_key="block_rotating_ad_domains",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
state=lambda data: data.block_rotating_ad_domains,
|
||||
),
|
||||
NextDnsSwitchEntityDescription(
|
||||
key="ai_threat_detection",
|
||||
translation_key="ai_threat_detection",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
state=lambda data: data.ai_threat_detection,
|
||||
),
|
||||
NextDnsSwitchEntityDescription(
|
||||
key="block_algorithmically_generated_domains",
|
||||
translation_key="block_algorithmically_generated_domains",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
state=lambda data: data.block_algorithmically_generated_domains,
|
||||
),
|
||||
NextDnsSwitchEntityDescription(
|
||||
key="block_csam",
|
||||
translation_key="block_csam",
|
||||
|
||||
@@ -199,6 +199,56 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_algorithmically_generated_domains-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ConfigSubentry subentry_type='profile' title='Fake Profile'>,
|
||||
'device_class': None,
|
||||
'device_id': <DeviceEntry identifiers=[('nextdns', 'xyz12')]>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.fake_profile_block_algorithmically_generated_domains',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Block algorithmically generated domains',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Block algorithmically generated domains',
|
||||
'platform': 'nextdns',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'block_algorithmically_generated_domains',
|
||||
'unique_id': 'xyz12_block_algorithmically_generated_domains',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_algorithmically_generated_domains-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Fake Profile Block algorithmically generated domains',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.fake_profile_block_algorithmically_generated_domains',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_amazon-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
@@ -2399,6 +2449,56 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_rotating_ad_domains-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ConfigSubentry subentry_type='profile' title='Fake Profile'>,
|
||||
'device_class': None,
|
||||
'device_id': <DeviceEntry identifiers=[('nextdns', 'xyz12')]>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.fake_profile_block_rotating_ad_domains',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Block rotating ad domains',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Block rotating ad domains',
|
||||
'platform': 'nextdns',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'block_rotating_ad_domains',
|
||||
'unique_id': 'xyz12_block_rotating_ad_domains',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_rotating_ad_domains-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Fake Profile Block rotating ad domains',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.fake_profile_block_rotating_ad_domains',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_switch[switch.fake_profile_block_signal-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
|
||||
Reference in New Issue
Block a user