Refactor Ring data handling (#30777)

* Refactor Ring data handling

* Add async_ to methods
This commit is contained in:
Paulus Schoutsen authored and Franck Nijhof committed 2020-01-15 20:17:36 +01:00
1 parent 1c70435df6
commit 3fd14ca3cf
9 files changed
+514 -482

No files matched your search

+10 -1
View File
@@ -1,4 +1,5 @@
"""The tests for the Ring binary sensor platform."""
from time import time
from unittest.mock import patch
from .common import setup_platform
@@ -8,7 +9,15 @@ async def test_binary_sensor(hass, requests_mock):
"""Test the Ring binary sensors."""
with patch(
"ring_doorbell.Ring.active_alerts",
return_value=[{"kind": "motion", "doorbot_id": 987654}],
return_value=[
{
"kind": "motion",
"doorbot_id": 987654,
"state": "ringing",
"now": time(),
"expires_in": 180,
}
],
):
await setup_platform(hass, "binary_sensor")