Skip to content

Implementation ​

Code Paths ​

  • Startup orchestrator: src/lib/hotspot/bootstrap.ts
  • Runtime state: src/lib/stores/hotspotStore.ts
  • Provider orchestration: src/lib/hotspot/HotspotManager.ts
  • Layout integration: src/routes/+layout.ts
  • Provider normalization: src/lib/hotspot/providers/normalizers.ts
  • Hotspot set command strategy: src/lib/hotspot/providers/setEnabledCommand.ts

Provider Strategy ​

Priorite de resolution dans HotspotManager:

  1. TvHostHotspotProvider
  2. AndroidHotspotProvider
  3. PhilipsHotspotProvider

TvHostHotspotProvider.isSupported() est durci avec un probe HOTSPOT_GET (timeout court) pour eviter les faux positifs.

State Model ​

Le hotspotStore expose un etat explicite:

  • status: unknown | loading | unsupported | starting | waiting_credentials | retrying | failed_start | enabled | disabled | error
  • isActive, credentials, supported, providerId, lastUpdatedAt, error, retryCount, nextRetryAt, lastAttemptAt

Auto-start au boot + retry backoff ​

Si le provider est supporte mais que le hotspot est inactif, le bootstrap tente un demarrage automatique:

  1. HOTSPOT_SET avec params: { subAction: 'start' }
  2. Polling des credentials pendant une fenetre de 12s
  3. Si echec, passage en retry background avec backoff (5s, 10s, 20s, 40s, puis 60s cap)

Contrat bridge HOTSPOT_SET ​

Mode principal (cible):

  • HOTSPOT_SET + subAction: 'start' | 'stop'

Fallback temporaire (legacy, deprecie):

  • HOTSPOT_SET + isEnabled: boolean

Le fallback est conserve uniquement pour compatibilite multi-host et doit etre purge des que tous les hosts Android sont migres sur subAction.

Legacy Compatibility ​

updateHotspotStatus() maintient la synchronisation de:

  • hotspotMode
  • hotspotParams

Ces stores restent compatibles pendant la transition.


Retour au README