diff --git a/tests/components/ring/conftest.py b/tests/components/ring/conftest.py index e9800393835..97a956f0f05 100644 --- a/tests/components/ring/conftest.py +++ b/tests/components/ring/conftest.py @@ -120,4 +120,8 @@ def requests_mock_fixture(): status_code=200, json={"url": "http://127.0.0.1/foo"}, ) + mock.get( + "https://api.ring.com/groups/v1/locations/mock-location-id/groups", + text=load_fixture("groups.json", "ring"), + ) yield mock diff --git a/tests/components/ring/fixtures/devices.json b/tests/components/ring/fixtures/devices.json index aff234f9726..83f406f2bc9 100644 --- a/tests/components/ring/fixtures/devices.json +++ b/tests/components/ring/fixtures/devices.json @@ -375,5 +375,92 @@ "subscribed_motions": true, "time_zone": "America/New_York" } + ], + "other": [ + { + "id": 185036587, + "kind": "intercom_handset_audio", + "description": "Ingress", + "location_id": "mock-location-id", + "schema_id": null, + "is_sidewalk_gateway": false, + "created_at": "2023-12-01T18:05:25Z", + "deactivated_at": null, + "owner": { + "id": 762490876, + "first_name": "", + "last_name": "", + "email": "" + }, + "device_id": "124ba1b3fe1a", + "time_zone": "Europe/Rome", + "firmware_version": "Up to Date", + "owned": true, + "ring_net_id": null, + "settings": { + "features_confirmed": 5, + "show_recordings": true, + "recording_ttl": 180, + "recording_enabled": false, + "keep_alive": null, + "keep_alive_auto": 45.0, + "doorbell_volume": 8, + "enable_chime": 1, + "theft_alarm_enable": 0, + "use_cached_domain": 1, + "use_server_ip": 0, + "server_domain": "fw.ring.com", + "server_ip": null, + "enable_log": 1, + "forced_keep_alive": null, + "mic_volume": 11, + "chime_settings": { + "enable": true, + "type": 2, + "duration": 10 + }, + "intercom_settings": { + "ring_to_open": false, + "predecessor": "{\"make\":\"Comelit\",\"model\":\"2738W\",\"wires\":2}", + "config": "{\"intercom_type\": 2, \"number_of_wires\": 2, \"autounlock_enabled\": false, \"speaker_gain\": [-49, -35, -25, -21, -16, -9, -6, -3, 0, 3, 6, 9], \"digital\": {\"audio_amp\": 0, \"chg_en\": false, \"fast_chg\": false, \"bypass\": false, \"idle_lvl\": 32, \"ext_audio\": false, \"ext_audio_term\": 0, \"off_hk_tm\": 0, \"unlk_ka\": false, \"unlock\": {\"cap_tm\": 1000, \"rpl_tm\": 1500, \"gain\": 1000, \"cmp_thr\": 4000, \"lvl\": 25000, \"thr\": 30, \"thr2\": 0, \"offln\": false, \"ac\": true, \"bias\": \"h\", \"tx_pin\": \"TXD2\", \"ack\": 0, \"prot\": \"Comelit_SB2\", \"ask\": {\"f\": 25000, \"b\": 333}}, \"ring\": {\"cap_tm\": 40, \"rpl_tm\": 200, \"gain\": 2000, \"cmp_thr\": 4500, \"lvl\": 28000, \"thr\": 30, \"thr2\": 0, \"offln\": false, \"ac\": true, \"bias\": \"m\", \"tx_pin\": \"TXD2\", \"ack\": 0, \"prot\": \"Comelit_SB2\", \"ask\": {\"f\": 25000, \"b\": 333}}, \"hook_off\": {\"cap_tm\": 1000, \"rpl_tm\": 1500, \"gain\": 1000, \"cmp_thr\": 4000, \"lvl\": 25000, \"thr\": 30, \"thr2\": 0, \"offln\": false, \"ac\": true, \"bias\": \"h\", \"tx_pin\": \"TXD2\", \"ack\": 0, \"prot\": \"Comelit_SB2\", \"ask\": {\"f\": 25000, \"b\": 333}}, \"hook_on\": {\"cap_tm\": 1000, \"rpl_tm\": 1500, \"gain\": 1000, \"cmp_thr\": 4000, \"lvl\": 25000, \"thr\": 30, \"thr2\": 0, \"offln\": false, \"ac\": true, \"bias\": \"h\", \"tx_pin\": \"TXD2\", \"ack\": 0, \"prot\": \"Comelit_SB2\", \"ask\": {\"f\": 25000, \"b\": 333}}}}", + "intercom_type": "DF", + "replication": 1, + "unlock_mode": 0 + }, + "voice_volume": 11 + }, + "alerts": { + "connection": "online", + "ota_status": "timeout" + }, + "function": { + "name": null + }, + "subscribed": false, + "battery_life": "52", + "features": { + "cfes_eligible": false, + "motion_zone_recommendation": false, + "motions_enabled": true, + "show_recordings": true, + "show_vod_settings": true, + "rich_notifications_eligible": false, + "show_offline_motion_events": false, + "sheila_camera_eligible": null, + "sheila_camera_processing_eligible": null, + "dynamic_network_switching_eligible": false, + "chime_auto_detect_capable": false, + "missing_key_delivery_address": false, + "show_24x7_lite": false, + "recording_24x7_eligible": null + }, + "metadata": { + "ethernet": false, + "legacy_fw_migrated": true, + "imported_from_amazon": false, + "is_sidewalk_gateway": false, + "key_access_point_associated": true + } + } ] } diff --git a/tests/components/ring/fixtures/groups.json b/tests/components/ring/fixtures/groups.json new file mode 100644 index 00000000000..399aaac1641 --- /dev/null +++ b/tests/components/ring/fixtures/groups.json @@ -0,0 +1,24 @@ +{ + "device_groups": [ + { + "device_group_id": "mock-group-id", + "location_id": "mock-location-id", + "name": "Landscape", + "devices": [ + { + "doorbot_id": 12345678, + "location_id": "mock-location-id", + "type": "beams_ct200_transformer", + "mac_address": null, + "hardware_id": "1234567890", + "name": "Mock Transformer", + "deleted_at": null + } + ], + "created_at": "2020-11-03T22:07:05Z", + "updated_at": "2020-11-19T03:52:59Z", + "deleted_at": null, + "external_id": "12345678-1234-5678-90ab-1234567890ab" + } + ] +} diff --git a/tests/components/ring/snapshots/test_diagnostics.ambr b/tests/components/ring/snapshots/test_diagnostics.ambr index 64e753ba2b3..142552772b8 100644 --- a/tests/components/ring/snapshots/test_diagnostics.ambr +++ b/tests/components/ring/snapshots/test_diagnostics.ambr @@ -574,6 +574,91 @@ 'subscribed_motions': True, 'time_zone': 'America/New_York', }), + dict({ + 'alerts': dict({ + 'connection': 'online', + 'ota_status': 'timeout', + }), + 'battery_life': '52', + 'created_at': '2023-12-01T18:05:25Z', + 'deactivated_at': None, + 'description': '**REDACTED**', + 'device_id': '**REDACTED**', + 'features': dict({ + 'cfes_eligible': False, + 'chime_auto_detect_capable': False, + 'dynamic_network_switching_eligible': False, + 'missing_key_delivery_address': False, + 'motion_zone_recommendation': False, + 'motions_enabled': True, + 'recording_24x7_eligible': None, + 'rich_notifications_eligible': False, + 'sheila_camera_eligible': None, + 'sheila_camera_processing_eligible': None, + 'show_24x7_lite': False, + 'show_offline_motion_events': False, + 'show_recordings': True, + 'show_vod_settings': True, + }), + 'firmware_version': 'Up to Date', + 'function': dict({ + 'name': None, + }), + 'id': '**REDACTED**', + 'is_sidewalk_gateway': False, + 'kind': 'intercom_handset_audio', + 'location_id': '**REDACTED**', + 'metadata': dict({ + 'ethernet': False, + 'imported_from_amazon': False, + 'is_sidewalk_gateway': False, + 'key_access_point_associated': True, + 'legacy_fw_migrated': True, + }), + 'owned': True, + 'owner': dict({ + 'email': '', + 'first_name': '', + 'id': '**REDACTED**', + 'last_name': '', + }), + 'ring_net_id': None, + 'schema_id': None, + 'settings': dict({ + 'chime_settings': dict({ + 'duration': 10, + 'enable': True, + 'type': 2, + }), + 'doorbell_volume': 8, + 'enable_chime': 1, + 'enable_log': 1, + 'features_confirmed': 5, + 'forced_keep_alive': None, + 'intercom_settings': dict({ + 'config': '{"intercom_type": 2, "number_of_wires": 2, "autounlock_enabled": false, "speaker_gain": [-49, -35, -25, -21, -16, -9, -6, -3, 0, 3, 6, 9], "digital": {"audio_amp": 0, "chg_en": false, "fast_chg": false, "bypass": false, "idle_lvl": 32, "ext_audio": false, "ext_audio_term": 0, "off_hk_tm": 0, "unlk_ka": false, "unlock": {"cap_tm": 1000, "rpl_tm": 1500, "gain": 1000, "cmp_thr": 4000, "lvl": 25000, "thr": 30, "thr2": 0, "offln": false, "ac": true, "bias": "h", "tx_pin": "TXD2", "ack": 0, "prot": "Comelit_SB2", "ask": {"f": 25000, "b": 333}}, "ring": {"cap_tm": 40, "rpl_tm": 200, "gain": 2000, "cmp_thr": 4500, "lvl": 28000, "thr": 30, "thr2": 0, "offln": false, "ac": true, "bias": "m", "tx_pin": "TXD2", "ack": 0, "prot": "Comelit_SB2", "ask": {"f": 25000, "b": 333}}, "hook_off": {"cap_tm": 1000, "rpl_tm": 1500, "gain": 1000, "cmp_thr": 4000, "lvl": 25000, "thr": 30, "thr2": 0, "offln": false, "ac": true, "bias": "h", "tx_pin": "TXD2", "ack": 0, "prot": "Comelit_SB2", "ask": {"f": 25000, "b": 333}}, "hook_on": {"cap_tm": 1000, "rpl_tm": 1500, "gain": 1000, "cmp_thr": 4000, "lvl": 25000, "thr": 30, "thr2": 0, "offln": false, "ac": true, "bias": "h", "tx_pin": "TXD2", "ack": 0, "prot": "Comelit_SB2", "ask": {"f": 25000, "b": 333}}}}', + 'intercom_type': 'DF', + 'predecessor': '{"make":"Comelit","model":"2738W","wires":2}', + 'replication': 1, + 'ring_to_open': False, + 'unlock_mode': 0, + }), + 'keep_alive': None, + 'keep_alive_auto': 45.0, + 'mic_volume': 11, + 'recording_enabled': False, + 'recording_ttl': 180, + 'server_domain': 'fw.ring.com', + 'server_ip': None, + 'show_recordings': True, + 'theft_alarm_enable': 0, + 'use_cached_domain': 1, + 'use_server_ip': 0, + 'voice_volume': 11, + }), + 'subscribed': False, + 'time_zone': 'Europe/Rome', + }), ]), }) # --- diff --git a/tests/components/ring/test_init.py b/tests/components/ring/test_init.py index 8d169002e38..155b68a23af 100644 --- a/tests/components/ring/test_init.py +++ b/tests/components/ring/test_init.py @@ -205,11 +205,11 @@ async def test_error_on_global_update( [ ( RingTimeout, - "Error fetching devices data: Timeout communicating with API for device Front: ", + "Error fetching devices data: Timeout communicating with API for device Front Door: ", ), ( RingError, - "Error fetching devices data: Error communicating with API for device Front: ", + "Error fetching devices data: Error communicating with API for device Front Door: ", ), ], ids=["timeout-error", "other-error"],