Skip to content

Keep alert capabilities for unmapped doorbell kinds - #562

Closed
trulyshelton wants to merge 1 commit into
python-ring-doorbell:masterfrom
trulyshelton:fix/unmapped-doorbell-kind-capabilities
Closed

trulyshelton wants to merge 1 commit into
python-ring-doorbell:masterfrom
trulyshelton:fix/unmapped-doorbell-kind-capabilities

Conversation

@trulyshelton

Copy link
Copy Markdown

Summary

  • An unmapped doorbell kind now keeps DING, MOTION_DETECTION and VIDEO capabilities instead of silently reporting False for all three.
  • The unmapped kind is logged (once per kind, at warning level) so it can be reported and mapped properly.
  • Battery and knock are unchanged: those stay dependent on the real hardware/settings, not on the kind.

Why

Ring releases new doorbell models faster than this mapping is updated. Until a kind is added, RingDoorBell.model falls through to Unknown Doorbell and has_capability() returns False for ding/motion/video, which is destructive rather than merely cosmetic:

  • Home Assistant only creates the event.<doorbell>_ding / event.<doorbell>_motion entities when those capabilities are present (components/ring/event.py).
  • Those event entities are the only subscribers of the integration's RingListenCoordinator, and the coordinator only starts RingEventListener (the FCM push connection) when it gets its first listener (components/ring/coordinator.py).

So an unrecognised doorbell does not just lose its model name, it loses realtime events entirely and every recording is only picked up by the one minute polling fallback (SCAN_INTERVAL = timedelta(minutes=1)), which cannot be tuned from the UI.

Measured on a real unmapped device (kind = cocoa_doorbell_v4w, Ring Wired Video Doorbell Plus 2nd Gen, firmware cam-1.33.12300) running Home Assistant 2026.10.4 / ring-doorbell 0.9.14, using the recorder over 11 days and 120 events: median 62s from the Ring event created_at to the Home Assistant state write, p90 90s, of which normally ~1s is the notification dispatch itself. The device appears in the registry as Unknown Doorbell with no ding/motion entities.

Everything in doorbots and authorized_doorbots is a doorbell, so assuming the standard alerts is safe: if a device turns out not to emit dings, the entity simply never fires. Being able to receive a doorbell press at all is worth more than being strict about an unmapped model.

Testing

uv run pytest -q                       # 42 passed
uv run ruff check ring_doorbell/doorbot.py tests/test_ring.py      # All checks passed
uv run ruff format --check ring_doorbell/doorbot.py tests/test_ring.py
uv run mypy ring_doorbell/doorbot.py   # Success

New tests cover an unmapped kind reporting the standard capabilities, and the warning being emitted once rather than on every property access.

Notes

This deliberately does not add a kind mapping, so the model name stays Unknown Doorbell for these devices - #539 already adds cocoa_doorbell_v4w as DOORBELL_WIRED_PLUS_2_KINDS and can land (or not) independently. This change means users are not left with a dead doorbell while that happens, and the warning tells them exactly which kind to report.

Refs #521, #543

Ring ships new doorbell models far faster than the kind mapping is
updated, so a brand new doorbell - or any model that was never added
here - falls through to Unknown Doorbell.

For such a kind, has_capability() returns False for DING, MOTION_DETECTION
and VIDEO. Consumers use those capabilities to decide whether a device can
produce alerts at all: Home Assistant only creates the ding/motion event
entities when they are set, and it only starts the Ring event listener when
those entities register with the listen coordinator. An unmapped doorbell
therefore goes silent - no ring/motion events, and every new recording is
only picked up by the one minute polling fallback instead of the realtime
push, which adds around a minute to every notification.

Everything in the doorbots and authorized_doorbots families is a doorbell,
so assume the standard alerts for an unmapped kind instead of dropping them,
and log the kind once so it can be reported and mapped properly. Battery and
knock stay hardware/settings dependent and are unchanged.

Refs #521, #543
@trulyshelton trulyshelton closed this by deleting the head repository Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant