Minor updates to discovery and device types

This commit is contained in:
Sasha Hilton 2021-02-09 03:16:40 +00:00
parent a3ad8eb962
commit deabf1f915
2 changed files with 32 additions and 1 deletions

View file

@ -75,7 +75,7 @@ impl Discovery {
"status": 101, "status": 101,
"statusString": "ERROR-OK", "statusString": "ERROR-OK",
"spotifyError": 0, "spotifyError": 0,
"version": "2.1.0", "version": "2.7.1",
"deviceID": (self.0.device_id), "deviceID": (self.0.device_id),
"remoteName": (self.0.config.name), "remoteName": (self.0.config.name),
"activeUser": "", "activeUser": "",
@ -85,6 +85,9 @@ impl Discovery {
"accountReq": "PREMIUM", "accountReq": "PREMIUM",
"brandDisplayName": "librespot", "brandDisplayName": "librespot",
"modelDisplayName": "librespot", "modelDisplayName": "librespot",
"resolverVersion": "0",
"groupStatus": "NONE",
"voiceSupport": "NO",
}); });
let body = result.to_string(); let body = result.to_string();

View file

@ -36,6 +36,16 @@ pub enum DeviceType {
AVR = 6, AVR = 6,
STB = 7, STB = 7,
AudioDongle = 8, AudioDongle = 8,
GameConsole = 9,
CastAudio = 10,
CastVideo = 11,
Automobile = 12,
Smartwatch = 13,
Chromebook = 14,
UnknownSpotify = 100,
CarThing = 101,
Observer = 102,
HomeThing = 103,
} }
impl FromStr for DeviceType { impl FromStr for DeviceType {
@ -51,6 +61,14 @@ impl FromStr for DeviceType {
"avr" => Ok(AVR), "avr" => Ok(AVR),
"stb" => Ok(STB), "stb" => Ok(STB),
"audiodongle" => Ok(AudioDongle), "audiodongle" => Ok(AudioDongle),
"gameconsole" => Ok(GameConsole),
"castaudio" => Ok(CastAudio),
"castvideo" => Ok(CastVideo),
"automobile" => Ok(Automobile),
"smartwatch" => Ok(Smartwatch),
"chromebook" => Ok(Chromebook),
"carthing" => Ok(CarThing),
"homething" => Ok(HomeThing),
_ => Err(()), _ => Err(()),
} }
} }
@ -69,6 +87,16 @@ impl fmt::Display for DeviceType {
AVR => f.write_str("AVR"), AVR => f.write_str("AVR"),
STB => f.write_str("STB"), STB => f.write_str("STB"),
AudioDongle => f.write_str("AudioDongle"), AudioDongle => f.write_str("AudioDongle"),
GameConsole => f.write_str("GameConsole"),
CastAudio => f.write_str("CastAudio"),
CastVideo => f.write_str("CastVideo"),
Automobile => f.write_str("Automobile"),
Smartwatch => f.write_str("Smartwatch"),
Chromebook => f.write_str("Chromebook"),
UnknownSpotify => f.write_str("UnknownSpotify"),
CarThing => f.write_str("CarThing"),
Observer => f.write_str("Observer"),
HomeThing => f.write_str("HomeThing"),
} }
} }
} }