From 57692a91165d14b2eeb7d863b0f5e5543127f3b2 Mon Sep 17 00:00:00 2001 From: Ryan Ronnander <61520+ryan-ronnander@users.noreply.github.com> Date: Thu, 24 Sep 2026 10:54:10 -0400 Subject: [PATCH] Move VeSync display, child lock and auto off switches to Configuration (#183016) --- homeassistant/components/vesync/switch.py | 3 + .../vesync/snapshots/test_diagnostics.ambr | 6 +- .../vesync/snapshots/test_switch.ambr | 294 +++++++++--------- 3 files changed, 153 insertions(+), 150 deletions(-) diff --git a/homeassistant/components/vesync/switch.py b/homeassistant/components/vesync/switch.py index 12a69e6298a5..d5da424db33e 100644 --- a/homeassistant/components/vesync/switch.py +++ b/homeassistant/components/vesync/switch.py @@ -100,6 +100,7 @@ SENSOR_DESCRIPTIONS: Final[tuple[VeSyncSwitchEntityDescription, ...]] = ( lambda device: rgetattr(device, "state.display_set_status") is not None ), translation_key="display", + entity_category=EntityCategory.CONFIG, on_fn=lambda device: _toggle_display(device, True), off_fn=lambda device: _toggle_display(device, False), ), @@ -108,6 +109,7 @@ SENSOR_DESCRIPTIONS: Final[tuple[VeSyncSwitchEntityDescription, ...]] = ( is_on=lambda device: device.state.child_lock, exists_fn=(lambda device: rgetattr(device, "state.child_lock") is not None), translation_key="child_lock", + entity_category=EntityCategory.CONFIG, on_fn=lambda device: _toggle_child_lock(device, True), off_fn=lambda device: _toggle_child_lock(device, False), ), @@ -118,6 +120,7 @@ SENSOR_DESCRIPTIONS: Final[tuple[VeSyncSwitchEntityDescription, ...]] = ( lambda device: rgetattr(device, "state.automatic_stop_config") is not None ), translation_key="auto_off_config", + entity_category=EntityCategory.CONFIG, on_fn=lambda device: _toggle_auto_stop(device, True), off_fn=lambda device: _toggle_auto_stop(device, False), ), diff --git a/tests/components/vesync/snapshots/test_diagnostics.ambr b/tests/components/vesync/snapshots/test_diagnostics.ambr index a599acafccf3..df29fa9e4ee3 100644 --- a/tests/components/vesync/snapshots/test_diagnostics.ambr +++ b/tests/components/vesync/snapshots/test_diagnostics.ambr @@ -403,7 +403,7 @@ 'disabled': False, 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': 'config', 'entity_id': 'switch.test_fan_auto_off', 'icon': None, 'name': None, @@ -427,7 +427,7 @@ 'disabled': False, 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': 'config', 'entity_id': 'switch.test_fan_child_lock', 'icon': None, 'name': None, @@ -451,7 +451,7 @@ 'disabled': False, 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': 'config', 'entity_id': 'switch.test_fan_display', 'icon': None, 'name': None, diff --git a/tests/components/vesync/snapshots/test_switch.ambr b/tests/components/vesync/snapshots/test_switch.ambr index b3f0eba8c265..a9fcfdda03ea 100644 --- a/tests/components/vesync/snapshots/test_switch.ambr +++ b/tests/components/vesync/snapshots/test_switch.ambr @@ -45,7 +45,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_131s_display', 'has_entity_name': True, 'hidden_by': None, @@ -129,7 +129,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_200s_display', 'has_entity_name': True, 'hidden_by': None, @@ -164,7 +164,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_200s_child_lock', 'has_entity_name': True, 'hidden_by': None, @@ -261,7 +261,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_400s_display', 'has_entity_name': True, 'hidden_by': None, @@ -296,7 +296,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_400s_child_lock', 'has_entity_name': True, 'hidden_by': None, @@ -393,7 +393,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_600s_display', 'has_entity_name': True, 'hidden_by': None, @@ -428,7 +428,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.air_purifier_600s_child_lock', 'has_entity_name': True, 'hidden_by': None, @@ -551,6 +551,138 @@ list([ ]) # --- +# name: test_switch_state[CoreBreeze 432S][devices] + list([ + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entry_id': , + 'config_subentry_id': , + 'configuration_url': None, + 'connections': set({ + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'vesync', + 'corebreeze432s', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'VeSync', + 'model': 'LPF-R432S-AEU', + 'model_id': None, + 'name': 'CoreBreeze 432S', + 'name_by_user': None, + 'serial_number': None, + 'sw_version': None, + 'via_device_id': None, + }), + ]) +# --- +# name: test_switch_state[CoreBreeze 432S][entities] + list([ + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.corebreeze_432s_display', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Display', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Display', + 'platform': 'vesync', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'display', + 'unique_id': 'corebreeze432s-display', + 'unit_of_measurement': None, + }), + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.corebreeze_432s_child_lock', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Child lock', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Child lock', + 'platform': 'vesync', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'child_lock', + 'unique_id': 'corebreeze432s-child_lock', + 'unit_of_measurement': None, + }), + ]) +# --- +# name: test_switch_state[CoreBreeze 432S][switch.corebreeze_432s_child_lock] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'CoreBreeze 432S Child lock', + }), + 'context': , + 'entity_id': 'switch.corebreeze_432s_child_lock', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switch_state[CoreBreeze 432S][switch.corebreeze_432s_display] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'CoreBreeze 432S Display', + }), + 'context': , + 'entity_id': 'switch.corebreeze_432s_display', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_switch_state[Dimmable Light][devices] list([ DeviceRegistryEntrySnapshot({ @@ -669,7 +801,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_200s_display', 'has_entity_name': True, 'hidden_by': None, @@ -704,7 +836,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_200s_auto_off', 'has_entity_name': True, 'hidden_by': None, @@ -801,7 +933,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_6000s_display', 'has_entity_name': True, 'hidden_by': None, @@ -836,7 +968,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_6000s_child_lock', 'has_entity_name': True, 'hidden_by': None, @@ -871,7 +1003,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_6000s_auto_off', 'has_entity_name': True, 'hidden_by': None, @@ -1029,7 +1161,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_600s_display', 'has_entity_name': True, 'hidden_by': None, @@ -1064,7 +1196,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.humidifier_600s_auto_off', 'has_entity_name': True, 'hidden_by': None, @@ -1246,7 +1378,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'switch', - 'entity_category': None, + 'entity_category': , 'entity_id': 'switch.smarttowerfan_display', 'has_entity_name': True, 'hidden_by': None, @@ -1405,135 +1537,3 @@ 'state': 'on', }) # --- -# name: test_switch_state[CoreBreeze 432S][devices] - list([ - DeviceRegistryEntrySnapshot({ - 'area_id': None, - 'config_entry_id': , - 'config_subentry_id': , - 'configuration_url': None, - 'connections': set({ - }), - 'disabled_by': None, - 'entry_type': None, - 'hw_version': None, - 'id': , - 'identifiers': set({ - tuple( - 'vesync', - 'corebreeze432s', - ), - }), - 'labels': set({ - }), - 'manufacturer': 'VeSync', - 'model': 'LPF-R432S-AEU', - 'model_id': None, - 'name': 'CoreBreeze 432S', - 'name_by_user': None, - 'serial_number': None, - 'sw_version': None, - 'via_device_id': None, - }), - ]) -# --- -# name: test_switch_state[CoreBreeze 432S][entities] - list([ - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': None, - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'switch', - 'entity_category': None, - 'entity_id': 'switch.corebreeze_432s_display', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'Display', - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': 'Display', - 'platform': 'vesync', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'display', - 'unique_id': 'corebreeze432s-display', - 'unit_of_measurement': None, - }), - EntityRegistryEntrySnapshot({ - 'aliases': list([ - None, - ]), - 'area_id': None, - 'capabilities': None, - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'switch', - 'entity_category': None, - 'entity_id': 'switch.corebreeze_432s_child_lock', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'Child lock', - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': 'Child lock', - 'platform': 'vesync', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'child_lock', - 'unique_id': 'corebreeze432s-child_lock', - 'unit_of_measurement': None, - }), - ]) -# --- -# name: test_switch_state[CoreBreeze 432S][switch.corebreeze_432s_display] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'CoreBreeze 432S Display', - }), - 'context': , - 'entity_id': 'switch.corebreeze_432s_display', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': 'off', - }) -# --- -# name: test_switch_state[CoreBreeze 432S][switch.corebreeze_432s_child_lock] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - : 'CoreBreeze 432S Child lock', - }), - 'context': , - 'entity_id': 'switch.corebreeze_432s_child_lock', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': 'off', - }) -# ---