HA-Commander icon indicating copy to clipboard operation
HA-Commander copied to clipboard

AttributeError

Open robertoleonardo opened this issue 1 year ago • 2 comments

Please type any relevant information here

started getting this error today on multiple machines. i did get a new iphone recently but the plugins been working fine for a few days since adding it to my HA so i don't think that's the issue despite the error mentioning iphone. unclear why this happened all of a sudden in the last few hours though, i don't think ha was updated or anything in that time

Trace Log

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

robertoleonardo avatar Sep 24 '24 03:09 robertoleonardo

sorry - disregard this. a re-install seems to fix the issue. odd that it happened on both machines and was so simply to fix, but whatever - it works now :)

robertoleonardo avatar Sep 24 '24 03:09 robertoleonardo

Might be also fixed by #68 If the source_list does not contain an attribute of the current_source, the MediaPlayer view cannot visually display which attribute is currently "active". This seems to happen more frequently with third-party plugins where the source is not permanently active in HA. In short, no attribute can be marked as "active" that no longer appears in the MediaPlayer list.

Gh0stExp10it avatar Jan 09 '25 15:01 Gh0stExp10it