-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsonos-state.ts
31 lines (29 loc) · 923 Bytes
/
sonos-state.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Track, ChannelValue, ExtendedTransportState } from '@svrooij/sonos/lib/models'
/**
* Object that keeps the state of each device,
* this is what is changed by the events and published to mqtt as a full object.
*
* @remarks If you want to add stuff also add it to the event handlers.
* @export
* @interface SonosState
*/
export interface SonosState extends SonosStateBase {
readonly uuid: string;
readonly model: string;
ts: number;
name: string;
groupName: string;
coordinatorUuid: string;
volume: ChannelValue<number>;
mute: ChannelValue<boolean>;
currentTrack: Track | string;
nextTrack: Track | string;
enqueuedMetadata: Track | string;
transportState: ExtendedTransportState;
playmode: string;
bass: number;
treble: number;
}
interface SonosStateBase {
[key: string]: string | number | Track | ChannelValue<number> | ChannelValue<boolean> | ExtendedTransportState;
}