Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ring_doorbell/chime.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ async def async_set_volume(self, value: int) -> None:
}
url = CHIMES_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

async def async_get_linked_tree(self) -> dict[str, Any]:
"""Return doorbell data linked to chime."""
Expand Down
1 change: 1 addition & 0 deletions ring_doorbell/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ async def motion_detection(ctx, ring: Ring, device_name, turn_on, turn_off):
return None

await device.async_set_motion_detection(turn_on if turn_on else False)
await ring.async_update_devices()
state = "on" if device.motion_detection else "off"
echo(f"{device!s} motion detection set to {state}")
return None
Expand Down
5 changes: 0 additions & 5 deletions ring_doorbell/doorbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ async def async_set_existing_doorbell_type(self, value: int) -> None:
if self.existing_doorbell_type:
url = DOORBELLS_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

@property
def existing_doorbell_type_enabled(self) -> bool | None:
Expand Down Expand Up @@ -237,7 +236,6 @@ async def async_set_existing_doorbell_type_enabled(self, value: bool) -> None:
}
url = DOORBELLS_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

@property
def existing_doorbell_type_duration(self) -> int | None:
Expand Down Expand Up @@ -273,7 +271,6 @@ async def async_set_existing_doorbell_type_duration(self, value: int) -> None:
}
url = DOORBELLS_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

async def async_get_last_recording_id(self) -> int | None:
"""Return the last recording ID."""
Expand Down Expand Up @@ -388,7 +385,6 @@ async def async_set_volume(self, value: int) -> None:
}
url = DOORBELLS_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

@property
def connection_status(self) -> str | None:
Expand Down Expand Up @@ -450,7 +446,6 @@ async def async_set_motion_detection(self, state: bool) -> None: # noqa: FBT001
payload = {"motion_settings": {"motion_detection_enabled": state}}

await self._ring.async_query(url, method="PATCH", json=payload)
await self._ring.async_update_devices()

async def generate_webrtc_stream(
self, sdp_offer: str, keep_alive_timeout: int | None = 30
Expand Down
6 changes: 5 additions & 1 deletion ring_doorbell/listen/eventlistener.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__(
self._callbacks: dict[int, OnNotificationCallable] = {}
self.subscribed = False
self.started = False
self._app_id = self._ring.auth.get_hardware_id()
self._device_model = self._ring.auth.get_device_model()

self._credentials = credentials
Expand Down Expand Up @@ -166,6 +165,7 @@ async def start(
timeout: int = 10,
) -> bool:
"""Start the listener."""
_logger.debug("Starting event listener")
if not self._receiver:
fcm_config = FcmRegisterConfig(
FCM_PROJECT_ID, FCM_APP_ID, FCM_API_KEY, FCM_RING_SENDER_ID
Expand Down Expand Up @@ -196,6 +196,7 @@ async def start(
self.session_refresh_task = asyncio.create_task(
self._periodic_session_refresh()
)
_logger.debug("Started event listener")
return self.started

async def _periodic_session_refresh(self) -> None:
Expand Down Expand Up @@ -276,8 +277,11 @@ def _on_notification(
ring_event = self._get_ring_event(msg_data)

if ring_event:
_logger.debug("Event received %s", ring_event)
for callback in self._callbacks.values():
callback(ring_event)
else:
_logger.debug("Unknown event received %s", msg_data)

def _get_ring_event(self, msg_data: dict) -> RingEvent | None:
if (android_config_str := msg_data.get("android_config")) is None or (
Expand Down
6 changes: 0 additions & 6 deletions ring_doorbell/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ async def async_set_doorbell_volume(self, value: int) -> None:
}
url = DOORBELLS_ENDPOINT.format(self.device_api_id)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

@property
def keep_alive_auto(self) -> float | None:
Expand All @@ -152,7 +151,6 @@ async def async_set_keep_alive_auto(self, value: float) -> None:
payload = {"keep_alive_settings": {"keep_alive_auto": value}}

await self._ring.async_query(url, method="PATCH", json=payload)
await self._ring.async_update_devices()

@property
def mic_volume(self) -> int | None:
Expand All @@ -170,7 +168,6 @@ async def async_set_mic_volume(self, value: int) -> None:
payload = {"volume_settings": {"mic_volume": value}}

await self._ring.async_query(url, method="PATCH", json=payload)
await self._ring.async_update_devices()

@property
def voice_volume(self) -> int | None:
Expand All @@ -188,7 +185,6 @@ async def async_set_voice_volume(self, value: int) -> None:
payload = {"volume_settings": {"voice_volume": value}}

await self._ring.async_query(url, method="PATCH", json=payload)
await self._ring.async_update_devices()

async def async_get_clip_length_max(self) -> int | None:
"""Get the Maximum clip length."""
Expand All @@ -206,7 +202,6 @@ async def async_set_clip_length_max(self, value: int) -> None:
url = SETTINGS_ENDPOINT.format(self.device_api_id)
payload = {"video_settings": {"clip_length_max": value}}
await self._ring.async_query(url, method="PATCH", json=payload)
await self._ring.async_update_devices()

@property
def connection_status(self) -> str | None:
Expand Down Expand Up @@ -246,7 +241,6 @@ async def async_open_door(self, user_id: int = -1) -> bool:
}
resp = await self._ring.async_query(url, method="PUT", json=payload)
response = resp.json()
await self._ring.async_update_devices()
if response.get("result", {}).get("code", -1) == 0:
return True

Expand Down
2 changes: 0 additions & 2 deletions ring_doorbell/stickup_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ async def async_set_lights(self, state: str) -> None:

url = LIGHTS_ENDPOINT.format(self.device_api_id, state)
await self._ring.async_query(url, method="PUT")
await self._ring.async_update_devices()

@property
def siren(self) -> int:
Expand All @@ -177,7 +176,6 @@ async def async_set_siren(self, duration: int) -> None:
params = {}
url = SIREN_ENDPOINT.format(self.device_api_id, state)
await self._ring.async_query(url, extra_params=params, method="PUT")
await self._ring.async_update_devices()

DEPRECATED_API_PROPERTY_SETTERS: ClassVar = {
*RingDoorBell.DEPRECATED_API_PROPERTY_SETTERS,
Expand Down