Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceType 'Smartwatch' is missing #177

Closed
cudajo opened this issue Nov 21, 2023 · 0 comments · Fixed by #178
Closed

DeviceType 'Smartwatch' is missing #177

cudajo opened this issue Nov 21, 2023 · 0 comments · Fixed by #178

Comments

@cudajo
Copy link

cudajo commented Nov 21, 2023

When calling SpotifyAPI.player.devices() it sometimes generates following error:

Invalid argument(s): `Smartwatch` is not one of the supported values: Computer, Tablet, Smartphone, Speaker, TV, AVR, STB, AudioDongle, GameConsole, CastVideo, CastAudio, Automobile, Unknown

When the exception was thrown, this was the stack: 
#0      $enumDecodeNullable (package:json_annotation/src/enum_helpers.dart:37:5)
#1      _$DeviceFromJson (package:spotify/src/models/_models.g.dart:488:12)
#2      new Device.fromJson (package:spotify/src/models/device.dart:11:57)
#3      PlayerEndpoint._parseDeviceJson.<anonymous closure> (package:spotify/src/endpoints/player.dart:80:39)
#4      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#5      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#6      _iterablePartsToStrings (dart:core/iterable.dart:933:13)
#7      Iterable.iterableToShortString (dart:core/iterable.dart:843:7)

I assume me having Spotify installed on my smart watch (Samsung Galaxy Watch 4) causes this issue when checking for available devices, as 'Smartwatch' isn't one of the enumerated DeviceTypes.

(Interestingly enough, and despite not having used my smart watch to play Spotify recently, the call to SpotifyAPI.player.devices() only sometimes seems to discover my smart watch as an available device. And when checking the official Spotify app in my phone at the same time this happens, it does not show my smart watch as available...)

@cudajo cudajo changed the title DeviceType Smartwatch is missing DeviceType 'Smartwatch' is missing Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant