With supports_on_off set to False, the card takes a few minutes (2? - some sort of timeout) after I manually to go from ON to Unavailable state
With supports_on_off set to True, if I press the power icon in HA while the KEFs are On, they turn off as expected, so powering off remotely works fine. The Card state behaves as above though: it keeps showing ON even if the KEFs are off, for a few minutes, and then it goes to Unavailable.
In both cases, if I turn ON the KEFs manually, the card will take a few minutes to go from Unavailable to ON.
In no case the state is set to Off. It’s either ON or Unavailable.
All other features work very well. Setting the input, muting, changing volume, auto-off timer all works great.
The only issue I found is with Off state detection, not working well.
The following error appears in the Log:
2020-01-18 17:53:50 ERROR (MainThread) [aiokef.aiokef] Timeout in waiting for reply 2020-01-18 17:57:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.kef_ls50w fails
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/aiokef/aiokef.py", line 131, in open_connection
task, timeout=_TIMEOUT File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for raise futures.TimeoutError()
concurrent.futures._base.TimeoutError The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 57, in call
result = yield from fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/aiokef/aiokef.py", line 197, in send_message
await self.open_connection()
File "/usr/local/lib/python3.7/site-packages/aiokef/aiokef.py", line 143,
in open_connection
raise ConnectionRefusedError("Speaker is offline.") from e
ConnectionRefusedError: Speaker is offline.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 5
7, in call
result = yield from fn(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/aiokef/aiokef.py", line 323,
in get_volume_and_is_muted
volume = await self._comm.send_message(COMMANDS["get_volume"]) File "/usr/local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 5
4, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 351, in iter six.raise_from(retry_exc, fut.exception()) File "<string>", line 3, in raise_from tenacity.RetryError: RetryError[<Future at 0x71757730 state=finished raised ConnectionRefusedError>]
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
await self.async_update() File "/config/custom_components/kef_custom/media_player.py", line 186, in async_update
) = await self._speaker.get_volume_and_is_muted() File "/usr/local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 54, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.7/site-packages/tenacity/__init__.py", line 351, in iter
six.raise_from(retry_exc, fut.exception())
File "<string>", line 3, in raise_from tenacity.RetryError: RetryError[<Future at 0x7181fa30 state=finished raised RetryError>]