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>
The local .env holds a long-lived HA token used for development;
keep it out of any push.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Samsung rebuilt account.samsung.com as a JS SPA backed by /iam/oauth2,
so the integration's HTML-scraping QR flow can no longer find the
signin URL and /accounts/v1/FMM2/signInWithQrCode now 404s. The STF
backend (chkLogin.do, getDeviceList.do, ...) is unchanged.
Replace the multi-step QR config flow with a single form that asks
the user to paste the JSESSIONID cookie copied from a logged-in
browser session at smartthingsfind.samsung.com. validate_jsessionid
hits chkLogin.do to verify the cookie before accepting it.
Also bundle in earlier compatibility fixes for newer HA: store
devices in hass.data so the coordinator can look them up by
entry_id, and use async_on_update on the device_tracker entity.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>