Appearance
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:
TvHostHotspotProviderAndroidHotspotProviderPhilipsHotspotProvider
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 | errorisActive,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:
HOTSPOT_SETavecparams: { subAction: 'start' }- Polling des credentials pendant une fenetre de 12s
- Si echec, passage en retry background avec backoff (
5s,10s,20s,40s, puis60scap)
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:
hotspotModehotspotParams
Ces stores restent compatibles pendant la transition.