ol-iver / denonavr

Automation Library for Denon AVR receivers.
MIT License
176 stars 67 forks source link

improve logging, prevent unnecessary errors #131

Closed starkillerOG closed 4 years ago

starkillerOG commented 4 years ago

@scarface-4711 Could you merge this and push to a new version?

Is it also alright if I start converting the DenonAVR integration in HomeAssistant to a Config Flow? (A Config Flow is now required for all integrations that communicate with devices / do I/O).

JPHutchins commented 4 years ago

@starkillerOG I'd love to learn how to add the config flow so I will follow your changes over there. Going to read this today and hopefully it will inspire me on some of the "hang issues" people are reporting.
https://realpython.com/async-io-python/

starkillerOG commented 4 years ago

@JPHutchins I just finished a PR that implements Config Flow for the Xiaomi Miio platform (https://github.com/home-assistant/core/pull/32091) if you are intrested you can see how I did it there. The DenonAVR platform will be pretty simular.

starkillerOG commented 4 years ago

@JPHutchins I might need your help: I started working on the config flow in this branch: https://github.com/starkillerOG/home-assistant/tree/patch-23

For the config flow I need to make a unique id, something like the mac adress/serial number something that is unique to the device so two of the same devices have a diffrent value while the value always stays the same for a device.

For me I can get the serial number and model by using: http://192.168.1.IP:8080/description.xml

I know that on your newer receiver this url gets you device information wich also includes serial number and model: http://192.168.0.119:60006/upnp/desc/aios_device/aios_device.xml

What I want to know, does http://192.168.1.IP:8080/description.xml also work for you? Otherwise I will need to implement multiple ways of getting the serial number....

JPHutchins commented 4 years ago

@starkillerOG I am getting nothing (Error 403) at http://192.168.1.IP:8080/description.xml. The port 60006 works as you suggested.

Maybe try to find a lazier way to get a unique response... IP wouldn't work cause it could change. Is it easier to get the model number and cross fingers that someone doesn't have two of the same model?

Don't want to get you into the weeds, but: https://superuser.com/questions/188799/how-to-find-the-mac-address-of-a-remote-computer

ol-iver commented 4 years ago

thanks 😄