Platinum-Fix Sprint (sprints 3 + 4)
Addresses HA integration audit findings against best practices for 2026 (docs/_research/2026-05-01_codebase-audit-ha-2026.md). 16 stories across two sprints; 23 commits; 707 → 739 tests; mypy strict clean; 0 lint errors.
Critical fixes
- Inject HA-managed websession into
GoveeApiClientandGoveeAuthClient. Drops bareaiohttp.ClientSession()instantiation in favor ofasync_get_clientsession(hass). Closes the falseinject-websessionPlatinum claim. PARALLEL_UPDATES = 0in all 11 platform modules. Coordinator-pushed updates no longer throttled to 1 concurrent call. Closes the falseparallel-updatesPlatinum claim.- IoT credentials moved from
hass.data[DOMAIN]toentry.datawith a v1→v2 schema migration (async_migrate_entry). Eliminates cross-entry leak risk; aligns with canonical HA storage pattern.
High / functional fixes
- MAC-format device IDs redacted in diagnostics output (PII per HA guidance) + 15 new regression tests.
- Detached
hass.async_create_taskin repairs flow replaced with awaitedflow.async_init(lifecycle-bound). dataclasses.replacefor state mutation in coordinator BLE recovery path (in-place mutation could mask state change for listeners).async_create_background_taskfor rate-limit-issue task so it cancels on entry unload.
Hygiene
manifest.json:quality_scale: silver; remove emptyssdp/zeroconfarrays.DeviceInfoimport path normalized (homeassistant.helpers.device_registry).- Services registration guarded by
hass.services.has_service(no fragilehass.datasentinel). - Transport keys in
extra_state_attributesgated behindCONF_EXPOSE_TRANSPORT_ENTITIES(default off). - Redundant
hass.states.async_removebeforeentity_registry.async_removeremoved. quality_scale.yamlclaims now match implementation;stale-devicesflipped to done.
Tests
- 707 → 739 (+32: 16 diagnostics + 1 coordinator regression + 16 migration regression)
- mypy
--strict: clean - coverage: 55.4%
Notes
- Removed
min_ha_versionfrommanifest.json— hassfest rejects unknown keys; HACS already enforces viahacs.json. - Coordinator decomposition (audit H1, 1691 LOC monolith) deferred to a separate refactor sprint.
- Open audit follow-ups:
option_flow=deprecation check (2025.12), aiomqtt reconnect health audit, observer-unregister audit.