Skip to content

feat: TypeScript Snoo client (pysnoo2 rewrite) #406

@ng

Description

@ng

Context

Rewrite pysnoo2 (Python) as a TypeScript module for sleepypod-core. This is the foundational piece for Sleepypod Mini.

Scope

Auth

  • OAuth PKCE flow to Happiest Baby API
  • Token refresh and persistence
  • Derive PubNub UUIDs and JWT tokens from auth session

Data API (REST)

  • Get device status
  • Get session history (sleep sessions with timestamps, duration, soothe levels)
  • Get baby profile
  • Get device settings (lock, weaning mode, sound settings)

Control API (PubNub)

  • Subscribe to device state channel (real-time: baby state, motion level, soothe events)
  • Publish commands: start/stop, set soothe level (1-4), lock/unlock
  • Handle connection lifecycle (reconnect, token refresh)

Reference

Output

  • src/services/mini/client.ts — Snoo API client
  • src/services/mini/pubnub.ts — PubNub subscription manager
  • src/services/mini/types.ts — TypeScript types for Snoo data model

Parent

Epic: #405

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions