rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.52k stars 542 forks source link

Improve handling of unexpected device responses #1913

Open rytilahti opened 3 months ago

rytilahti commented 3 months ago

Some devices are known to return unexpected payloads in some conditions and the current code is not robust enough to check against such and raise more appropriate exceptions.

The protocol code should be adjusted to wrap unexpected exceptions inside DeviceException to make it easier for downstreams to handle.

Case example: https://github.com/home-assistant/core/issues/95669