By default media players get a chrome cast icon, which feels
quite wrong for my old style amplifier that doesn't have any
connection to the rest of the word, except for a RS232 port.
Some amplifiers/receivers do not report any volume (due to them not
knowing), for example NAD C 356BEE is documented to return an empty
string for volume.
At least don't crash when we get None back.
nad_receiver received a few fixes in 0.0.12, which enables the integration
for me. I assume it may depend on the receiver model, but my receiver only reports
mute state and volume when it's on, while the library used to assume to always
get a reply. With 0.0.11 the nad integration simply excepts on startup,
after bumping the version up it works.
Fixes this:
2020-04-18 22:59:38 ERROR (MainThread) [homeassistant.components.media_player] nad: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 324, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/nad/media_player.py", line 195, in update
if self._nad_receiver.main_mute("?") == "Off":
File "/usr/local/lib/python3.7/site-packages/nad_receiver/__init__.py", line 71, in main_mute
return self.exec_command('main', 'mute', operator, value)
File "/usr/local/lib/python3.7/site-packages/nad_receiver/__init__.py", line 62, in exec_command
return msg.decode().strip().split('=')[1]
IndexError: list index out of range
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS