Skip to content

AttributeError #58

@skiant

Description

@skiant

Please type any relevant information here

Heya! Love the work you've done on HA Commander, it's been wonderful to use.
I've added a Sonos Era 100 speaker in my setup and since then, every time I type ha to invoke a command, I get this error.

This happens whenever I played something on the Sonos via Spotify Connect, attributes on the media player entity are updated and include source: Spotify Connect and stays that way until I play something using another source.

If I play something using Sonos Radio for instance, the source attribute disappear on the media player entity.

Trace Log

Traceback (most recent call last):
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\launcher.py, line 44, in run
    results = request_method(*request_parameters) or self._results
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\__init__.py, line 131, in _query
    self.query(query)
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\main.py, line 53, in query
    states = self.client.states()
             ^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 122, in states
    entities.append(self.create_entity(entity))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 147, in create_entity
    return _cls(self, entity)
           ^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 328, in __init__
    getattr(self, current_source).icon = radiobox-marked
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MediaPlayer' object has no attribute 'Spotify Connect'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions