HA-SmartThings-Find/custom_components/smartthings_find
Jeena 7457a8284b Fix coordinator wiring after refactor
Two bugs left from the hass.data move that surfaced as soon as the
integration ran on the live HA:

* In async_setup_entry, devices were stored in hass.data AFTER
  coordinator.async_config_entry_first_refresh(), but
  _async_update_data reads them from hass.data — so the very first
  refresh raised KeyError 'devices' and the entry stayed in
  setup_retry. Move the hass.data update before first_refresh.

* SmartThingsDeviceTracker called self.async_on_update(...) which
  isn't a method on TrackerEntity. Without a working listener
  registration the tracker stayed restored=true / unavailable
  forever. Subscribe in async_added_to_hass and use async_on_remove
  for cleanup, which is the documented pattern.

Verified end-to-end on a live HA: phones/watch produce GPS, battery
sensors populate, and the Ring button triggers a SmartTag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 02:01:05 +00:00
..
translations Replace broken QR login with manual JSESSIONID cookie 2026-05-05 01:16:22 +00:00
__init__.py Fix coordinator wiring after refactor 2026-05-05 02:01:05 +00:00
button.py Use entry_id for local data (fixes #10, #13) 2024-06-19 09:11:56 +02:00
config_flow.py Replace broken QR login with manual JSESSIONID cookie 2026-05-05 01:16:22 +00:00
const.py Add option to enable/disable active mode and make update_interval configurable (closes #11) 2024-06-19 12:15:05 +02:00
device_tracker.py Fix coordinator wiring after refactor 2026-05-05 02:01:05 +00:00
manifest.json Replace broken QR login with manual JSESSIONID cookie 2026-05-05 01:16:22 +00:00
sensor.py Use entry_id for local data (fixes #10, #13) 2024-06-19 09:11:56 +02:00
utils.py Replace broken QR login with manual JSESSIONID cookie 2026-05-05 01:16:22 +00:00