yoto-nodejs-client 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +523 -30
  2. package/bin/auth.js +36 -46
  3. package/bin/content.js +0 -0
  4. package/bin/device-model.d.ts +3 -0
  5. package/bin/device-model.d.ts.map +1 -0
  6. package/bin/device-model.js +360 -0
  7. package/bin/device-tui.TODO.md +125 -0
  8. package/bin/device-tui.d.ts +31 -0
  9. package/bin/device-tui.d.ts.map +1 -0
  10. package/bin/device-tui.js +1123 -0
  11. package/bin/devices.js +166 -28
  12. package/bin/groups.js +0 -0
  13. package/bin/icons.js +0 -0
  14. package/bin/lib/cli-helpers.d.ts +1 -1
  15. package/bin/lib/cli-helpers.d.ts.map +1 -1
  16. package/bin/lib/cli-helpers.js +5 -5
  17. package/bin/refresh-token.js +6 -6
  18. package/bin/token-info.js +3 -3
  19. package/index.d.ts +4 -585
  20. package/index.d.ts.map +1 -1
  21. package/index.js +11 -689
  22. package/lib/api-client.d.ts +576 -0
  23. package/lib/api-client.d.ts.map +1 -0
  24. package/lib/api-client.js +681 -0
  25. package/lib/api-endpoints/auth.d.ts +199 -8
  26. package/lib/api-endpoints/auth.d.ts.map +1 -1
  27. package/lib/api-endpoints/auth.js +224 -7
  28. package/lib/api-endpoints/auth.test.js +54 -2
  29. package/lib/api-endpoints/constants.d.ts +14 -8
  30. package/lib/api-endpoints/constants.d.ts.map +1 -1
  31. package/lib/api-endpoints/constants.js +17 -10
  32. package/lib/api-endpoints/content.test.js +1 -1
  33. package/lib/api-endpoints/devices.d.ts +405 -117
  34. package/lib/api-endpoints/devices.d.ts.map +1 -1
  35. package/lib/api-endpoints/devices.js +114 -52
  36. package/lib/api-endpoints/devices.test.js +1 -1
  37. package/lib/api-endpoints/{test-helpers.d.ts → endpoint-test-helpers.d.ts} +1 -1
  38. package/lib/api-endpoints/endpoint-test-helpers.d.ts.map +1 -0
  39. package/lib/api-endpoints/family-library-groups.test.js +1 -1
  40. package/lib/api-endpoints/family.test.js +1 -1
  41. package/lib/api-endpoints/icons.test.js +1 -1
  42. package/lib/helpers/power-state.d.ts +53 -0
  43. package/lib/helpers/power-state.d.ts.map +1 -0
  44. package/lib/helpers/power-state.js +73 -0
  45. package/lib/helpers/power-state.test.js +100 -0
  46. package/lib/helpers/temperature.d.ts +24 -0
  47. package/lib/helpers/temperature.d.ts.map +1 -0
  48. package/lib/helpers/temperature.js +61 -0
  49. package/lib/helpers/temperature.test.js +58 -0
  50. package/lib/helpers/typed-keys.d.ts +7 -0
  51. package/lib/helpers/typed-keys.d.ts.map +1 -0
  52. package/lib/helpers/typed-keys.js +8 -0
  53. package/lib/mqtt/client.d.ts +348 -22
  54. package/lib/mqtt/client.d.ts.map +1 -1
  55. package/lib/mqtt/client.js +213 -31
  56. package/lib/mqtt/factory.d.ts +22 -4
  57. package/lib/mqtt/factory.d.ts.map +1 -1
  58. package/lib/mqtt/factory.js +27 -5
  59. package/lib/mqtt/mqtt.test.js +85 -28
  60. package/lib/mqtt/topics.d.ts +41 -13
  61. package/lib/mqtt/topics.d.ts.map +1 -1
  62. package/lib/mqtt/topics.js +54 -20
  63. package/lib/pkg.d.cts +9 -0
  64. package/lib/token.d.ts +21 -6
  65. package/lib/token.d.ts.map +1 -1
  66. package/lib/token.js +30 -23
  67. package/lib/yoto-account.d.ts +163 -0
  68. package/lib/yoto-account.d.ts.map +1 -0
  69. package/lib/yoto-account.js +340 -0
  70. package/lib/yoto-device.d.ts +656 -0
  71. package/lib/yoto-device.d.ts.map +1 -0
  72. package/lib/yoto-device.js +2850 -0
  73. package/package.json +22 -15
  74. package/lib/api-endpoints/test-helpers.d.ts.map +0 -1
  75. /package/lib/api-endpoints/{test-helpers.js → endpoint-test-helpers.js} +0 -0
@@ -37,38 +37,38 @@ export function getDevices({ accessToken, userAgent, requestOptions }: {
37
37
  * @see https://yoto.dev/api/getdevicestatus/
38
38
  * @typedef {Object} YotoDeviceStatusResponse
39
39
  * @property {string} deviceId - Unique identifier of the device
40
- * @property {string} [activeCard] - Active card on the device (can be 'none')
41
- * @property {number} [ambientLightSensorReading] - Reading from ambient light sensor
42
- * @property {number} [averageDownloadSpeedBytesSecond] - Average download speed in bytes per second
43
- * @property {number} [batteryLevelPercentage] - Battery level in percentage
44
- * @property {number} [batteryLevelPercentageRaw] - Raw battery level percentage
45
- * @property {number} [buzzErrors] - Number of buzz errors
46
- * @property {0 | 1 | 2} [cardInsertionState] - Card insertion state (0=none, 1=physical, 2=remote)
47
- * @property {-1 | 0 | 1} [dayMode] - Day mode status (-1=unknown, 0=night, 1=day)
48
- * @property {number} [errorsLogged] - Number of errors logged
49
- * @property {string} [firmwareVersion] - Firmware version (e.g., 'v2.23.2')
50
- * @property {number} [freeDiskSpaceBytes] - Free disk space in bytes
51
- * @property {boolean} [isAudioDeviceConnected] - Whether audio device is connected
52
- * @property {boolean} [isBackgroundDownloadActive] - Whether background download is active
53
- * @property {boolean} [isBluetoothAudioConnected] - Whether Bluetooth audio is connected
54
- * @property {boolean} [isCharging] - Whether device is currently charging
55
- * @property {number} [isNfcLocked] - NFC lock status
56
- * @property {boolean} [isOnline] - Whether device is currently online
57
- * @property {string} [networkSsid] - Network SSID device is connected to
58
- * @property {string} [nightlightMode] - Nightlight mode (hex code or 'off')
59
- * @property {number} [playingSource] - Currently playing source
60
- * @property {string | null} [powerCapabilities] - Power capabilities (e.g., '0x02')
61
- * @property {0 | 1 | 2 | 3} [powerSource] - Power source (0=battery, 1=V2 dock, 2=USB-C, 3=Qi)
62
- * @property {number} [systemVolumePercentage] - System volume in percentage
63
- * @property {number} [taskWatchdogTimeoutCount] - Task watchdog timeout count
64
- * @property {number | string} [temperatureCelcius] - Temperature in Celsius (can be number, string like "0", or "notSupported")
65
- * @property {number} [totalDiskSpaceBytes] - Total disk space in bytes
66
- * @property {string} [updatedAt] - Timestamp of last update
67
- * @property {number} [uptime] - Uptime of the device in seconds
68
- * @property {number} [userVolumePercentage] - User volume in percentage
69
- * @property {number} [utcOffsetSeconds] - UTC offset in seconds
70
- * @property {number} [utcTime] - UTC time as Unix timestamp
71
- * @property {number} [wifiStrength] - WiFi connection strength in decibels
40
+ * @property {string} activeCard - Active card on the device (can be 'none')
41
+ * @property {number} ambientLightSensorReading - Reading from ambient light sensor
42
+ * @property {number} averageDownloadSpeedBytesSecond - Average download speed in bytes per second
43
+ * @property {number} batteryLevelPercentage - Battery level in percentage
44
+ * @property {number} batteryLevelPercentageRaw - Raw battery level percentage
45
+ * @property {number} buzzErrors - Number of buzz errors
46
+ * @property {0 | 1 | 2} cardInsertionState - Card insertion state from API (0=none, 1=physical, 2=remote) - converted to CardInsertionState string union in YotoDeviceStatus
47
+ * @property {-1 | 0 | 1} dayMode - Day mode status (-1=unknown, 0=night, 1=day)
48
+ * @property {number} errorsLogged - Number of errors logged
49
+ * @property {string} firmwareVersion - Firmware version (e.g., 'v2.23.2')
50
+ * @property {number} freeDiskSpaceBytes - Free disk space in bytes
51
+ * @property {boolean} isAudioDeviceConnected - Whether audio device is connected
52
+ * @property {boolean} isBackgroundDownloadActive - Whether background download is active
53
+ * @property {boolean} isBluetoothAudioConnected - Whether Bluetooth audio is connected
54
+ * @property {boolean} isCharging - Whether device is currently charging
55
+ * @property {number} isNfcLocked - NFC lock status
56
+ * @property {boolean} isOnline - Whether device is currently online
57
+ * @property {string} networkSsid - Network SSID device is connected to
58
+ * @property {string} nightlightMode - Current nightlight color (HTTP returns 'off' or '0x000000'; MQTT provides actual hex color like '0xff5733')
59
+ * @property {number} playingSource - Currently playing source
60
+ * @property {string | null} powerCapabilities - Power capabilities (e.g., '0x02')
61
+ * @property {0 | 1 | 2 | 3} powerSource - Power source (0=battery, 1=V2 dock, 2=USB-C, 3=Qi)
62
+ * @property {number} systemVolumePercentage - System/max volume in percentage (0-100, represents 0-16 hardware scale, maps to volumeMax in events)
63
+ * @property {number} taskWatchdogTimeoutCount - Task watchdog timeout count
64
+ * @property {string | number} temperatureCelcius - Temperature in Celsius (can be number or string like "0" or "notSupported") - Note: API misspells "Celsius"
65
+ * @property {number} totalDiskSpaceBytes - Total disk space in bytes
66
+ * @property {string} updatedAt - Timestamp of last update
67
+ * @property {number} uptime - Uptime of the device in seconds
68
+ * @property {number} userVolumePercentage - User volume in percentage (0-100, represents 0-16 hardware scale, maps to volume in events)
69
+ * @property {number} utcOffsetSeconds - UTC offset in seconds
70
+ * @property {number} utcTime - UTC time as Unix timestamp
71
+ * @property {number} wifiStrength - WiFi connection strength in decibels
72
72
  */
73
73
  /**
74
74
  * Retrieves the current status of a specific device.
@@ -113,44 +113,105 @@ export function getDeviceStatus({ accessToken, userAgent, deviceId, requestOptio
113
113
  * @property {string} releaseChannelId - Release channel identifier
114
114
  * @property {string} releaseChannelVersion - Release channel version
115
115
  * @property {string} fwVersion - Firmware version (undocumented)
116
- * @property {any} [status] - Device status object (undocumented)
117
- * @property {YotoDeviceShortcuts} [shortcuts] - Button shortcuts configuration (beta feature)
116
+ * @property {YotoDeviceFullStatus} status - Comprehensive device status object (undocumented)
117
+ * @property {YotoDeviceShortcuts} shortcuts - Button shortcuts configuration (beta feature)
118
+ */
119
+ /**
120
+ * Comprehensive device status from HTTP config endpoint (undocumented)
121
+ * Contains both user-facing fields and low-level hardware/diagnostic data
122
+ * Note: Many fields are nullable when device hasn't synced settings yet
123
+ * @typedef {Object} YotoDeviceFullStatus
124
+ * @property {string} activeCard - Active card ID or 'none'
125
+ * @property {number | null} aliveTime - Total time device has been alive
126
+ * @property {number} als - Ambient light sensor reading
127
+ * @property {number | null} battery - Raw battery voltage
128
+ * @property {number} batteryLevel - Battery level percentage
129
+ * @property {number} batteryLevelRaw - Raw battery level percentage
130
+ * @property {number | null} batteryRemaining - Battery remaining time estimate
131
+ * @property {0 | 1} bgDownload - Background download status (0 or 1)
132
+ * @property {0 | 1} bluetoothHp - Bluetooth headphones enabled (0 or 1)
133
+ * @property {number} buzzErrors - Number of buzz errors
134
+ * @property {number} bytesPS - Bytes per second transfer rate
135
+ * @property {0 | 1 | 2} cardInserted - Card insertion state (0=none, 1=physical, 2=remote)
136
+ * @property {number | null} chgStatLevel - Charge state level
137
+ * @property {0 | 1} charging - Charging state (0 or 1)
138
+ * @property {-1 | 0 | 1} day - Day mode (0=night, 1=day, -1=unknown)
139
+ * @property {number | null} dayBright - Day brightness setting
140
+ * @property {number | null} dbatTimeout - DBAT timeout value
141
+ * @property {string} deviceId - Device unique identifier
142
+ * @property {number | null} dnowBrightness - Current display brightness
143
+ * @property {number} errorsLogged - Number of errors logged
144
+ * @property {any} failData - Failure data (null if none)
145
+ * @property {any} failReason - Failure reason (null if none)
146
+ * @property {number | null} free - Free memory in bytes
147
+ * @property {number | null} free32 - Free 32-bit memory pool
148
+ * @property {number} freeDisk - Free disk space in bytes
149
+ * @property {number | null} freeDMA - Free DMA memory
150
+ * @property {string} fwVersion - Firmware version
151
+ * @property {0 | 1} headphones - Headphones connected (0 or 1)
152
+ * @property {string | null} lastSeenAt - Last seen timestamp
153
+ * @property {number | null} missedLogs - Number of missed log entries
154
+ * @property {string} nfcErrs - NFC errors (e.g., 'n/a')
155
+ * @property {number} nfcLock - NFC lock status
156
+ * @property {number | null} nightBright - Night brightness setting
157
+ * @property {string} nightlightMode - Current nightlight color (hex color like '0xff5733' or 'off')
158
+ * @property {number} playingStatus - Playing status code
159
+ * @property {string | null} powerCaps - Power capabilities
160
+ * @property {0 | 1 | 2 | 3} powerSrc - Power source (0=battery, 1=V2 dock, 2=USB-C, 3=Qi)
161
+ * @property {number | null} qiOtp - Qi OTP value
162
+ * @property {string | null} sd_info - SD card information
163
+ * @property {string | null} shutDown - Shutdown reason ('nA' = running, 'userShutdown' = powered off, etc.)
164
+ * @property {number | null} shutdownTimeout - Shutdown timeout in seconds
165
+ * @property {string} ssid - WiFi SSID
166
+ * @property {number | null} statusVersion - Status version number
167
+ * @property {string} temp - Temperature readings (format: 'value1:value2' or 'value1:notSupported')
168
+ * @property {'12' | '24' | null} timeFormat - Time format ('12' or '24')
169
+ * @property {number} totalDisk - Total disk space in bytes
170
+ * @property {number} twdt - Task watchdog timeout count
171
+ * @property {string} updatedAt - Last update timestamp (ISO 8601)
172
+ * @property {number} upTime - Uptime in seconds
173
+ * @property {number} userVolume - User volume setting (0-100 percentage, represents 0-16 hardware scale, maps to volume in events)
174
+ * @property {number} utcOffset - UTC offset in seconds
175
+ * @property {number} utcTime - UTC time as Unix timestamp
176
+ * @property {number} volume - System/max volume level (0-100 percentage, represents 0-16 hardware scale, maps to volumeMax in events)
177
+ * @property {number | null} wifiRestarts - Number of WiFi restarts
178
+ * @property {number} wifiStrength - WiFi signal strength in dBm
118
179
  */
119
180
  /**
120
181
  * @see https://yoto.dev/api/getdeviceconfig/
121
182
  * @typedef {Object} YotoDeviceConfig
122
- * @property {string[]} [alarms] - Array of alarm strings in comma-separated format (e.g., '1111111,1100,5WsQg,,,8')
183
+ * @property {string[]} alarms - Array of alarm strings in comma-separated format (e.g., '1111111,1100,5WsQg,,,8')
123
184
  * @property {string} ambientColour - Ambient light color (hex code)
124
185
  * @property {string} bluetoothEnabled - Bluetooth enabled state ('0' or '1')
125
186
  * @property {boolean} btHeadphonesEnabled - Bluetooth headphones enabled
126
- * @property {string} [clockFace] - Clock face style (e.g., 'digital-sun')
127
- * @property {string} dayDisplayBrightness - Day display brightness (e.g., 'auto')
128
- * @property {string} dayTime - Day mode start time (e.g., '07:30')
187
+ * @property {string} clockFace - Clock face style (e.g., 'digital-sun')
188
+ * @property {string} dayDisplayBrightness - Day display brightness (e.g., 'auto', '100')
189
+ * @property {string} dayTime - Day mode start time (e.g., '07:00')
129
190
  * @property {string} dayYotoDaily - Day mode Yoto Daily card path
130
191
  * @property {string} dayYotoRadio - Day mode Yoto Radio card path
131
- * @property {string} [daySoundsOff] - Day sounds off setting (undocumented)
132
- * @property {string} [displayDimBrightness] - Display dim brightness level
192
+ * @property {string} daySoundsOff - Day sounds off setting ('0' or '1') (undocumented)
193
+ * @property {string} displayDimBrightness - Display dim brightness level (undocumented)
133
194
  * @property {string} displayDimTimeout - Display dim timeout in seconds
134
195
  * @property {boolean} headphonesVolumeLimited - Whether headphones volume is limited
135
- * @property {string} [hourFormat] - Hour format ('12' or '24')
136
- * @property {string} [logLevel] - Log level (e.g., 'none') (undocumented)
137
- * @property {string} [locale] - Device locale (e.g., 'en') (undocumented)
196
+ * @property {string} hourFormat - Hour format ('12' or '24') (undocumented)
197
+ * @property {string} logLevel - Log level (e.g., 'none') (undocumented)
198
+ * @property {string} locale - Device locale (e.g., 'en') (undocumented)
138
199
  * @property {string} maxVolumeLimit - Maximum volume limit
139
200
  * @property {string} nightAmbientColour - Night ambient light color (hex code)
140
201
  * @property {string} nightDisplayBrightness - Night display brightness
141
202
  * @property {string} nightMaxVolumeLimit - Night maximum volume limit
142
- * @property {string} nightTime - Night mode start time (e.g., '19:30')
203
+ * @property {string} nightTime - Night mode start time (e.g., '19:20')
143
204
  * @property {string} nightYotoDaily - Night mode Yoto Daily card path
144
- * @property {string} nightYotoRadio - Night mode Yoto Radio card path
145
- * @property {string} [nightSoundsOff] - Night sounds off setting (undocumented)
146
- * @property {boolean} [pausePowerButton] - Pause on power button press (undocumented)
147
- * @property {boolean} [pauseVolumeDown] - Pause on volume down (undocumented)
205
+ * @property {string} nightYotoRadio - Night mode Yoto Radio card path (can be '0' for none)
206
+ * @property {string} nightSoundsOff - Night sounds off setting ('0' or '1') (undocumented)
207
+ * @property {boolean} pausePowerButton - Pause on power button press (undocumented)
208
+ * @property {boolean} pauseVolumeDown - Pause on volume down (undocumented)
148
209
  * @property {boolean} repeatAll - Whether repeat all is enabled
149
- * @property {boolean} [showDiagnostics] - Show diagnostics (undocumented)
210
+ * @property {boolean} showDiagnostics - Show diagnostics (undocumented)
150
211
  * @property {string} shutdownTimeout - Shutdown timeout in seconds
151
- * @property {string} [systemVolume] - System volume level (undocumented)
152
- * @property {string} [timezone] - Timezone setting (undocumented)
153
- * @property {string} [volumeLevel] - Volume level preset (e.g., 'safe')
212
+ * @property {string} systemVolume - System volume level (e.g., '100') (undocumented)
213
+ * @property {string} timezone - Timezone setting (empty string if not set) (undocumented)
214
+ * @property {string} volumeLevel - Volume level preset (e.g., 'safe') (undocumented)
154
215
  */
155
216
  /**
156
217
  * @see https://yoto.dev/api/getdeviceconfig/
@@ -348,131 +409,131 @@ export type YotoDeviceStatusResponse = {
348
409
  /**
349
410
  * - Active card on the device (can be 'none')
350
411
  */
351
- activeCard?: string;
412
+ activeCard: string;
352
413
  /**
353
414
  * - Reading from ambient light sensor
354
415
  */
355
- ambientLightSensorReading?: number;
416
+ ambientLightSensorReading: number;
356
417
  /**
357
418
  * - Average download speed in bytes per second
358
419
  */
359
- averageDownloadSpeedBytesSecond?: number;
420
+ averageDownloadSpeedBytesSecond: number;
360
421
  /**
361
422
  * - Battery level in percentage
362
423
  */
363
- batteryLevelPercentage?: number;
424
+ batteryLevelPercentage: number;
364
425
  /**
365
426
  * - Raw battery level percentage
366
427
  */
367
- batteryLevelPercentageRaw?: number;
428
+ batteryLevelPercentageRaw: number;
368
429
  /**
369
430
  * - Number of buzz errors
370
431
  */
371
- buzzErrors?: number;
432
+ buzzErrors: number;
372
433
  /**
373
- * - Card insertion state (0=none, 1=physical, 2=remote)
434
+ * - Card insertion state from API (0=none, 1=physical, 2=remote) - converted to CardInsertionState string union in YotoDeviceStatus
374
435
  */
375
- cardInsertionState?: 0 | 1 | 2;
436
+ cardInsertionState: 0 | 1 | 2;
376
437
  /**
377
438
  * - Day mode status (-1=unknown, 0=night, 1=day)
378
439
  */
379
- dayMode?: -1 | 0 | 1;
440
+ dayMode: -1 | 0 | 1;
380
441
  /**
381
442
  * - Number of errors logged
382
443
  */
383
- errorsLogged?: number;
444
+ errorsLogged: number;
384
445
  /**
385
446
  * - Firmware version (e.g., 'v2.23.2')
386
447
  */
387
- firmwareVersion?: string;
448
+ firmwareVersion: string;
388
449
  /**
389
450
  * - Free disk space in bytes
390
451
  */
391
- freeDiskSpaceBytes?: number;
452
+ freeDiskSpaceBytes: number;
392
453
  /**
393
454
  * - Whether audio device is connected
394
455
  */
395
- isAudioDeviceConnected?: boolean;
456
+ isAudioDeviceConnected: boolean;
396
457
  /**
397
458
  * - Whether background download is active
398
459
  */
399
- isBackgroundDownloadActive?: boolean;
460
+ isBackgroundDownloadActive: boolean;
400
461
  /**
401
462
  * - Whether Bluetooth audio is connected
402
463
  */
403
- isBluetoothAudioConnected?: boolean;
464
+ isBluetoothAudioConnected: boolean;
404
465
  /**
405
466
  * - Whether device is currently charging
406
467
  */
407
- isCharging?: boolean;
468
+ isCharging: boolean;
408
469
  /**
409
470
  * - NFC lock status
410
471
  */
411
- isNfcLocked?: number;
472
+ isNfcLocked: number;
412
473
  /**
413
474
  * - Whether device is currently online
414
475
  */
415
- isOnline?: boolean;
476
+ isOnline: boolean;
416
477
  /**
417
478
  * - Network SSID device is connected to
418
479
  */
419
- networkSsid?: string;
480
+ networkSsid: string;
420
481
  /**
421
- * - Nightlight mode (hex code or 'off')
482
+ * - Current nightlight color (HTTP returns 'off' or '0x000000'; MQTT provides actual hex color like '0xff5733')
422
483
  */
423
- nightlightMode?: string;
484
+ nightlightMode: string;
424
485
  /**
425
486
  * - Currently playing source
426
487
  */
427
- playingSource?: number;
488
+ playingSource: number;
428
489
  /**
429
490
  * - Power capabilities (e.g., '0x02')
430
491
  */
431
- powerCapabilities?: string | null;
492
+ powerCapabilities: string | null;
432
493
  /**
433
494
  * - Power source (0=battery, 1=V2 dock, 2=USB-C, 3=Qi)
434
495
  */
435
- powerSource?: 0 | 1 | 2 | 3;
496
+ powerSource: 0 | 1 | 2 | 3;
436
497
  /**
437
- * - System volume in percentage
498
+ * - System/max volume in percentage (0-100, represents 0-16 hardware scale, maps to volumeMax in events)
438
499
  */
439
- systemVolumePercentage?: number;
500
+ systemVolumePercentage: number;
440
501
  /**
441
502
  * - Task watchdog timeout count
442
503
  */
443
- taskWatchdogTimeoutCount?: number;
504
+ taskWatchdogTimeoutCount: number;
444
505
  /**
445
- * - Temperature in Celsius (can be number, string like "0", or "notSupported")
506
+ * - Temperature in Celsius (can be number or string like "0" or "notSupported") - Note: API misspells "Celsius"
446
507
  */
447
- temperatureCelcius?: number | string;
508
+ temperatureCelcius: string | number;
448
509
  /**
449
510
  * - Total disk space in bytes
450
511
  */
451
- totalDiskSpaceBytes?: number;
512
+ totalDiskSpaceBytes: number;
452
513
  /**
453
514
  * - Timestamp of last update
454
515
  */
455
- updatedAt?: string;
516
+ updatedAt: string;
456
517
  /**
457
518
  * - Uptime of the device in seconds
458
519
  */
459
- uptime?: number;
520
+ uptime: number;
460
521
  /**
461
- * - User volume in percentage
522
+ * - User volume in percentage (0-100, represents 0-16 hardware scale, maps to volume in events)
462
523
  */
463
- userVolumePercentage?: number;
524
+ userVolumePercentage: number;
464
525
  /**
465
526
  * - UTC offset in seconds
466
527
  */
467
- utcOffsetSeconds?: number;
528
+ utcOffsetSeconds: number;
468
529
  /**
469
530
  * - UTC time as Unix timestamp
470
531
  */
471
- utcTime?: number;
532
+ utcTime: number;
472
533
  /**
473
534
  * - WiFi connection strength in decibels
474
535
  */
475
- wifiStrength?: number;
536
+ wifiStrength: number;
476
537
  };
477
538
  export type YotoDeviceConfigResponse = {
478
539
  device: YotoDeviceConfigDevice;
@@ -547,19 +608,246 @@ export type YotoDeviceConfigDevice = {
547
608
  */
548
609
  fwVersion: string;
549
610
  /**
550
- * - Device status object (undocumented)
611
+ * - Comprehensive device status object (undocumented)
551
612
  */
552
- status?: any;
613
+ status: YotoDeviceFullStatus;
553
614
  /**
554
615
  * - Button shortcuts configuration (beta feature)
555
616
  */
556
- shortcuts?: YotoDeviceShortcuts;
617
+ shortcuts: YotoDeviceShortcuts;
618
+ };
619
+ /**
620
+ * Comprehensive device status from HTTP config endpoint (undocumented)
621
+ * Contains both user-facing fields and low-level hardware/diagnostic data
622
+ * Note: Many fields are nullable when device hasn't synced settings yet
623
+ */
624
+ export type YotoDeviceFullStatus = {
625
+ /**
626
+ * - Active card ID or 'none'
627
+ */
628
+ activeCard: string;
629
+ /**
630
+ * - Total time device has been alive
631
+ */
632
+ aliveTime: number | null;
633
+ /**
634
+ * - Ambient light sensor reading
635
+ */
636
+ als: number;
637
+ /**
638
+ * - Raw battery voltage
639
+ */
640
+ battery: number | null;
641
+ /**
642
+ * - Battery level percentage
643
+ */
644
+ batteryLevel: number;
645
+ /**
646
+ * - Raw battery level percentage
647
+ */
648
+ batteryLevelRaw: number;
649
+ /**
650
+ * - Battery remaining time estimate
651
+ */
652
+ batteryRemaining: number | null;
653
+ /**
654
+ * - Background download status (0 or 1)
655
+ */
656
+ bgDownload: 0 | 1;
657
+ /**
658
+ * - Bluetooth headphones enabled (0 or 1)
659
+ */
660
+ bluetoothHp: 0 | 1;
661
+ /**
662
+ * - Number of buzz errors
663
+ */
664
+ buzzErrors: number;
665
+ /**
666
+ * - Bytes per second transfer rate
667
+ */
668
+ bytesPS: number;
669
+ /**
670
+ * - Card insertion state (0=none, 1=physical, 2=remote)
671
+ */
672
+ cardInserted: 0 | 1 | 2;
673
+ /**
674
+ * - Charge state level
675
+ */
676
+ chgStatLevel: number | null;
677
+ /**
678
+ * - Charging state (0 or 1)
679
+ */
680
+ charging: 0 | 1;
681
+ /**
682
+ * - Day mode (0=night, 1=day, -1=unknown)
683
+ */
684
+ day: -1 | 0 | 1;
685
+ /**
686
+ * - Day brightness setting
687
+ */
688
+ dayBright: number | null;
689
+ /**
690
+ * - DBAT timeout value
691
+ */
692
+ dbatTimeout: number | null;
693
+ /**
694
+ * - Device unique identifier
695
+ */
696
+ deviceId: string;
697
+ /**
698
+ * - Current display brightness
699
+ */
700
+ dnowBrightness: number | null;
701
+ /**
702
+ * - Number of errors logged
703
+ */
704
+ errorsLogged: number;
705
+ /**
706
+ * - Failure data (null if none)
707
+ */
708
+ failData: any;
709
+ /**
710
+ * - Failure reason (null if none)
711
+ */
712
+ failReason: any;
713
+ /**
714
+ * - Free memory in bytes
715
+ */
716
+ free: number | null;
717
+ /**
718
+ * - Free 32-bit memory pool
719
+ */
720
+ free32: number | null;
721
+ /**
722
+ * - Free disk space in bytes
723
+ */
724
+ freeDisk: number;
725
+ /**
726
+ * - Free DMA memory
727
+ */
728
+ freeDMA: number | null;
729
+ /**
730
+ * - Firmware version
731
+ */
732
+ fwVersion: string;
733
+ /**
734
+ * - Headphones connected (0 or 1)
735
+ */
736
+ headphones: 0 | 1;
737
+ /**
738
+ * - Last seen timestamp
739
+ */
740
+ lastSeenAt: string | null;
741
+ /**
742
+ * - Number of missed log entries
743
+ */
744
+ missedLogs: number | null;
745
+ /**
746
+ * - NFC errors (e.g., 'n/a')
747
+ */
748
+ nfcErrs: string;
749
+ /**
750
+ * - NFC lock status
751
+ */
752
+ nfcLock: number;
753
+ /**
754
+ * - Night brightness setting
755
+ */
756
+ nightBright: number | null;
757
+ /**
758
+ * - Current nightlight color (hex color like '0xff5733' or 'off')
759
+ */
760
+ nightlightMode: string;
761
+ /**
762
+ * - Playing status code
763
+ */
764
+ playingStatus: number;
765
+ /**
766
+ * - Power capabilities
767
+ */
768
+ powerCaps: string | null;
769
+ /**
770
+ * - Power source (0=battery, 1=V2 dock, 2=USB-C, 3=Qi)
771
+ */
772
+ powerSrc: 0 | 1 | 2 | 3;
773
+ /**
774
+ * - Qi OTP value
775
+ */
776
+ qiOtp: number | null;
777
+ /**
778
+ * - SD card information
779
+ */
780
+ sd_info: string | null;
781
+ /**
782
+ * - Shutdown reason ('nA' = running, 'userShutdown' = powered off, etc.)
783
+ */
784
+ shutDown: string | null;
785
+ /**
786
+ * - Shutdown timeout in seconds
787
+ */
788
+ shutdownTimeout: number | null;
789
+ /**
790
+ * - WiFi SSID
791
+ */
792
+ ssid: string;
793
+ /**
794
+ * - Status version number
795
+ */
796
+ statusVersion: number | null;
797
+ /**
798
+ * - Temperature readings (format: 'value1:value2' or 'value1:notSupported')
799
+ */
800
+ temp: string;
801
+ /**
802
+ * - Time format ('12' or '24')
803
+ */
804
+ timeFormat: "12" | "24" | null;
805
+ /**
806
+ * - Total disk space in bytes
807
+ */
808
+ totalDisk: number;
809
+ /**
810
+ * - Task watchdog timeout count
811
+ */
812
+ twdt: number;
813
+ /**
814
+ * - Last update timestamp (ISO 8601)
815
+ */
816
+ updatedAt: string;
817
+ /**
818
+ * - Uptime in seconds
819
+ */
820
+ upTime: number;
821
+ /**
822
+ * - User volume setting (0-100 percentage, represents 0-16 hardware scale, maps to volume in events)
823
+ */
824
+ userVolume: number;
825
+ /**
826
+ * - UTC offset in seconds
827
+ */
828
+ utcOffset: number;
829
+ /**
830
+ * - UTC time as Unix timestamp
831
+ */
832
+ utcTime: number;
833
+ /**
834
+ * - System/max volume level (0-100 percentage, represents 0-16 hardware scale, maps to volumeMax in events)
835
+ */
836
+ volume: number;
837
+ /**
838
+ * - Number of WiFi restarts
839
+ */
840
+ wifiRestarts: number | null;
841
+ /**
842
+ * - WiFi signal strength in dBm
843
+ */
844
+ wifiStrength: number;
557
845
  };
558
846
  export type YotoDeviceConfig = {
559
847
  /**
560
848
  * - Array of alarm strings in comma-separated format (e.g., '1111111,1100,5WsQg,,,8')
561
849
  */
562
- alarms?: string[];
850
+ alarms: string[];
563
851
  /**
564
852
  * - Ambient light color (hex code)
565
853
  */
@@ -575,13 +863,13 @@ export type YotoDeviceConfig = {
575
863
  /**
576
864
  * - Clock face style (e.g., 'digital-sun')
577
865
  */
578
- clockFace?: string;
866
+ clockFace: string;
579
867
  /**
580
- * - Day display brightness (e.g., 'auto')
868
+ * - Day display brightness (e.g., 'auto', '100')
581
869
  */
582
870
  dayDisplayBrightness: string;
583
871
  /**
584
- * - Day mode start time (e.g., '07:30')
872
+ * - Day mode start time (e.g., '07:00')
585
873
  */
586
874
  dayTime: string;
587
875
  /**
@@ -593,13 +881,13 @@ export type YotoDeviceConfig = {
593
881
  */
594
882
  dayYotoRadio: string;
595
883
  /**
596
- * - Day sounds off setting (undocumented)
884
+ * - Day sounds off setting ('0' or '1') (undocumented)
597
885
  */
598
- daySoundsOff?: string;
886
+ daySoundsOff: string;
599
887
  /**
600
- * - Display dim brightness level
888
+ * - Display dim brightness level (undocumented)
601
889
  */
602
- displayDimBrightness?: string;
890
+ displayDimBrightness: string;
603
891
  /**
604
892
  * - Display dim timeout in seconds
605
893
  */
@@ -609,17 +897,17 @@ export type YotoDeviceConfig = {
609
897
  */
610
898
  headphonesVolumeLimited: boolean;
611
899
  /**
612
- * - Hour format ('12' or '24')
900
+ * - Hour format ('12' or '24') (undocumented)
613
901
  */
614
- hourFormat?: string;
902
+ hourFormat: string;
615
903
  /**
616
904
  * - Log level (e.g., 'none') (undocumented)
617
905
  */
618
- logLevel?: string;
906
+ logLevel: string;
619
907
  /**
620
908
  * - Device locale (e.g., 'en') (undocumented)
621
909
  */
622
- locale?: string;
910
+ locale: string;
623
911
  /**
624
912
  * - Maximum volume limit
625
913
  */
@@ -637,7 +925,7 @@ export type YotoDeviceConfig = {
637
925
  */
638
926
  nightMaxVolumeLimit: string;
639
927
  /**
640
- * - Night mode start time (e.g., '19:30')
928
+ * - Night mode start time (e.g., '19:20')
641
929
  */
642
930
  nightTime: string;
643
931
  /**
@@ -645,21 +933,21 @@ export type YotoDeviceConfig = {
645
933
  */
646
934
  nightYotoDaily: string;
647
935
  /**
648
- * - Night mode Yoto Radio card path
936
+ * - Night mode Yoto Radio card path (can be '0' for none)
649
937
  */
650
938
  nightYotoRadio: string;
651
939
  /**
652
- * - Night sounds off setting (undocumented)
940
+ * - Night sounds off setting ('0' or '1') (undocumented)
653
941
  */
654
- nightSoundsOff?: string;
942
+ nightSoundsOff: string;
655
943
  /**
656
944
  * - Pause on power button press (undocumented)
657
945
  */
658
- pausePowerButton?: boolean;
946
+ pausePowerButton: boolean;
659
947
  /**
660
948
  * - Pause on volume down (undocumented)
661
949
  */
662
- pauseVolumeDown?: boolean;
950
+ pauseVolumeDown: boolean;
663
951
  /**
664
952
  * - Whether repeat all is enabled
665
953
  */
@@ -667,23 +955,23 @@ export type YotoDeviceConfig = {
667
955
  /**
668
956
  * - Show diagnostics (undocumented)
669
957
  */
670
- showDiagnostics?: boolean;
958
+ showDiagnostics: boolean;
671
959
  /**
672
960
  * - Shutdown timeout in seconds
673
961
  */
674
962
  shutdownTimeout: string;
675
963
  /**
676
- * - System volume level (undocumented)
964
+ * - System volume level (e.g., '100') (undocumented)
677
965
  */
678
- systemVolume?: string;
966
+ systemVolume: string;
679
967
  /**
680
- * - Timezone setting (undocumented)
968
+ * - Timezone setting (empty string if not set) (undocumented)
681
969
  */
682
- timezone?: string;
970
+ timezone: string;
683
971
  /**
684
- * - Volume level preset (e.g., 'safe')
972
+ * - Volume level preset (e.g., 'safe') (undocumented)
685
973
  */
686
- volumeLevel?: string;
974
+ volumeLevel: string;
687
975
  };
688
976
  export type YotoDeviceShortcuts = {
689
977
  /**