I was setting up my Denon AVR-X4000 with this library and noticed a strange failure state. After reading your code and investigating what was causing this, I eventually tracked the problem to my device returning a rather weird description.xml file:
<?xml version="1.0"?>
<root ...>
<device>
...
<friendlyName></friendlyName>
<manufacturer>BridgeCo AG, Switzerland</manufacturer>
<manufacturerURL>http://www.bridgeco.com/</manufacturerURL>
<modelDescription>BridgeCo Digital Media Adapter with UPnP</modelDescription>
<modelName>DigitalMediaAdapterUPnP</modelName>
<modelNumber>03</modelNumber>
<modelURL>http://www.bridgeco.com/</modelURL>
...
</device>
</root>
After power cycling the device, the XML now returns correct values:
(Other than the lines shown above, the XML file was identical.)
I don't know what causes the device to start outputting these wrong values, but it appears I'm not alone in this. Here's the same problem occurring with a Marantz: https://github.com/home-assistant/core/issues/37351
Obviously there's nothing this library can do about the device returning corrupted model data but currently the library returns a generic error message and assigns a generic device state, per /denonavr/denonavr.py:500:
if device_info is None:
self._manufacturer = "Denon"
self._model_name = "Unknown"
self._serial_number = None
_LOGGER.error(
"Unable to get device information of host %s, can not "
"use the serial number as identification", self._host)
Because a generic device state is being returned, applications aren't able to help their users resolve this problem to get a fully functional experience. I propose that this corrupted state be identified in ssdp.py and a hard failure state (akin to a connection timeout) is triggered in denonavr.py.
except requests.exceptions.OhNoItsPrentendingToBeSomeBridgeCoDevice:
_LOGGER.error("Unable to get device information. Device is in a corrupted state. "
"Disconnect and reconnect power to the device and try again.")
return
I was setting up my Denon AVR-X4000 with this library and noticed a strange failure state. After reading your code and investigating what was causing this, I eventually tracked the problem to my device returning a rather weird description.xml file:
After power cycling the device, the XML now returns correct values:
(Other than the lines shown above, the XML file was identical.)
I don't know what causes the device to start outputting these wrong values, but it appears I'm not alone in this. Here's the same problem occurring with a Marantz: https://github.com/home-assistant/core/issues/37351
Obviously there's nothing this library can do about the device returning corrupted model data but currently the library returns a generic error message and assigns a generic device state, per /denonavr/denonavr.py:500:
Because a generic device state is being returned, applications aren't able to help their users resolve this problem to get a fully functional experience. I propose that this corrupted state be identified in
ssdp.py
and a hard failure state (akin to a connection timeout) is triggered indenonavr.py
.