diff --git a/homeassistant/components/switchbot_cloud/binary_sensor.py b/homeassistant/components/switchbot_cloud/binary_sensor.py index 55141e5b832e..6fb36c5d1c23 100644 --- a/homeassistant/components/switchbot_cloud/binary_sensor.py +++ b/homeassistant/components/switchbot_cloud/binary_sensor.py @@ -92,6 +92,10 @@ BINARY_SENSOR_DESCRIPTIONS_BY_DEVICE_TYPES = { CALIBRATION_DESCRIPTION, DOOR_OPEN_DESCRIPTION, ), + "Smart Lock Ultra Max": ( + CALIBRATION_DESCRIPTION, + DOOR_OPEN_DESCRIPTION, + ), "Smart Lock Vision": ( CALIBRATION_DESCRIPTION, DOOR_OPEN_DESCRIPTION, diff --git a/homeassistant/components/switchbot_cloud/const.py b/homeassistant/components/switchbot_cloud/const.py index 7f1ae51f1988..c88ffd3dc85f 100644 --- a/homeassistant/components/switchbot_cloud/const.py +++ b/homeassistant/components/switchbot_cloud/const.py @@ -94,6 +94,9 @@ DEVICE_SUPPORT_MAP: Final[dict[str, SwitchbotCloudDeviceConfig]] = { "Smart Lock Ultra": SwitchbotCloudDeviceConfig( True, entity_config=(Platform.SENSOR, Platform.BINARY_SENSOR, Platform.LOCK) ), + "Smart Lock Ultra Max": SwitchbotCloudDeviceConfig( + True, entity_config=(Platform.SENSOR, Platform.BINARY_SENSOR, Platform.LOCK) + ), "Smart Lock Vision": SwitchbotCloudDeviceConfig( True, entity_config=(Platform.SENSOR, Platform.BINARY_SENSOR, Platform.LOCK) ), diff --git a/homeassistant/components/switchbot_cloud/sensor.py b/homeassistant/components/switchbot_cloud/sensor.py index 376f69eb0ec9..75e63cf0f4c6 100644 --- a/homeassistant/components/switchbot_cloud/sensor.py +++ b/homeassistant/components/switchbot_cloud/sensor.py @@ -245,6 +245,10 @@ SENSOR_DESCRIPTIONS_BY_DEVICE_TYPES = { BATTERY_DESCRIPTION, LOCK_SENSOR_TYPE_LOCK_STATE_DESCRIPTION, ), + "Smart Lock Ultra Max": ( + BATTERY_DESCRIPTION, + LOCK_SENSOR_TYPE_LOCK_STATE_DESCRIPTION, + ), "Smart Lock Vision": (BATTERY_DESCRIPTION,), "Smart Lock Vision Pro": (BATTERY_DESCRIPTION,), "Lock Vision": (BATTERY_DESCRIPTION,), diff --git a/tests/components/switchbot_cloud/fixtures/sensor_status.json b/tests/components/switchbot_cloud/fixtures/sensor_status.json index d54cf269b572..ee53b292cef3 100644 --- a/tests/components/switchbot_cloud/fixtures/sensor_status.json +++ b/tests/components/switchbot_cloud/fixtures/sensor_status.json @@ -209,6 +209,16 @@ "doorState": "open", "calibrate": true }, + { + "deviceId": "7E50C3AEE222", + "deviceType": "Smart Lock Ultra Max", + "hubDeviceId": "FFFFFFFEEFF", + "battery": 100, + "version": "V6.3", + "lockState": "unlock", + "doorState": "open", + "calibrate": true + }, { "deviceId": "6D4F9C2A0E8B", "deviceType": "Lock Vision", diff --git a/tests/components/switchbot_cloud/snapshots/test_binary_sensor.ambr b/tests/components/switchbot_cloud/snapshots/test_binary_sensor.ambr index 3f1f8c46d2f2..0f8b14732f63 100644 --- a/tests/components/switchbot_cloud/snapshots/test_binary_sensor.ambr +++ b/tests/components/switchbot_cloud/snapshots/test_binary_sensor.ambr @@ -1223,6 +1223,108 @@ 'state': 'off', }) # --- +# name: test_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_calibration-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.test_device_name_1_calibration', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Calibration', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Calibration', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'calibration', + 'unique_id': 'test-device-id-1_calibrate', + 'unit_of_measurement': None, + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_calibration-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'problem', + : 'test-device-name-1 Calibration', + }), + 'context': , + 'entity_id': 'binary_sensor.test_device_name_1_calibration', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_door-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.test_device_name_1_door', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Door', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Door', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'test-device-id-1_doorState', + 'unit_of_measurement': None, + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_door-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'door', + : 'test-device-name-1 Door', + }), + 'context': , + 'entity_id': 'binary_sensor.test_device_name_1_door', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_coordinator_data[Smart Lock Ultra][binary_sensor.test_device_name_1_calibration-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -2906,6 +3008,108 @@ 'state': 'unknown', }) # --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_calibration-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.test_device_name_1_calibration', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Calibration', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Calibration', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'calibration', + 'unique_id': 'test-device-id-1_calibrate', + 'unit_of_measurement': None, + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_calibration-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'problem', + : 'test-device-name-1 Calibration', + }), + 'context': , + 'entity_id': 'binary_sensor.test_device_name_1_calibration', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_door-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.test_device_name_1_door', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Door', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Door', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'test-device-id-1_doorState', + 'unit_of_measurement': None, + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][binary_sensor.test_device_name_1_door-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'door', + : 'test-device-name-1 Door', + }), + 'context': , + 'entity_id': 'binary_sensor.test_device_name_1_door', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_no_coordinator_data[Smart Lock Ultra][binary_sensor.test_device_name_1_calibration-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/switchbot_cloud/snapshots/test_sensor.ambr b/tests/components/switchbot_cloud/snapshots/test_sensor.ambr index 85ddbf7df352..c0e1952edd95 100644 --- a/tests/components/switchbot_cloud/snapshots/test_sensor.ambr +++ b/tests/components/switchbot_cloud/snapshots/test_sensor.ambr @@ -2976,6 +2976,131 @@ 'state': '100', }) # --- +# name: test_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_device_name_1_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Battery', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Battery', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'test-device-id-1_battery', + 'unit_of_measurement': , + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'battery', + : 'test-device-name-1 Battery', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.test_device_name_1_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_lock_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'locked', + 'unlocked', + 'locking', + 'unlocking', + 'jammed', + 'latch_bolt_locked', + 'half_locked', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_device_name_1_lock_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Lock state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Lock state', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'lock_state', + 'unique_id': 'test-device-id-1_lockState', + 'unit_of_measurement': None, + }) +# --- +# name: test_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_lock_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'test-device-name-1 Lock state', + : list([ + 'locked', + 'unlocked', + 'locking', + 'unlocking', + 'jammed', + 'latch_bolt_locked', + 'half_locked', + ]), + }), + 'context': , + 'entity_id': 'sensor.test_device_name_1_lock_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_coordinator_data[Smart Lock Ultra][sensor.test_device_name_1_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -7214,6 +7339,131 @@ 'state': 'unknown', }) # --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_device_name_1_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Battery', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Battery', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'test-device-id-1_battery', + 'unit_of_measurement': , + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'battery', + : 'test-device-name-1 Battery', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.test_device_name_1_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_lock_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'locked', + 'unlocked', + 'locking', + 'unlocking', + 'jammed', + 'latch_bolt_locked', + 'half_locked', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.test_device_name_1_lock_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Lock state', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Lock state', + 'platform': 'switchbot_cloud', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'lock_state', + 'unique_id': 'test-device-id-1_lockState', + 'unit_of_measurement': None, + }) +# --- +# name: test_no_coordinator_data[Smart Lock Ultra Max][sensor.test_device_name_1_lock_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'test-device-name-1 Lock state', + : list([ + 'locked', + 'unlocked', + 'locking', + 'unlocking', + 'jammed', + 'latch_bolt_locked', + 'half_locked', + ]), + }), + 'context': , + 'entity_id': 'sensor.test_device_name_1_lock_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_no_coordinator_data[Smart Lock Ultra][sensor.test_device_name_1_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/switchbot_cloud/test_lock.py b/tests/components/switchbot_cloud/test_lock.py index c43013555a23..b7c0f500b12b 100644 --- a/tests/components/switchbot_cloud/test_lock.py +++ b/tests/components/switchbot_cloud/test_lock.py @@ -30,6 +30,7 @@ from . import configure_integration ("Lock Vision", 4), ("Lock Vision Pro", 5), ("Smart Lock Pro Wifi", 6), + ("Smart Lock Ultra Max", 7), ], ) async def test_lock( @@ -74,6 +75,7 @@ async def test_lock( ("Smart Lock", 0), ("Smart Lock Pro", 1), ("Smart Lock Ultra", 2), + ("Smart Lock Ultra Max", 3), ("Smart Lock Pro Wifi", 5), ], )