jeatheak / Mitsubishi-WF-RAC-Integration

WF-RAC homeassistant integration
MIT License
101 stars 19 forks source link

Config flow bugfix #19

Closed theawesomestrob closed 1 year ago

theawesomestrob commented 1 year ago

This fixes a bug where IP addresses were being compared by substring when adding a new device, and also some error messages were being hidden from the zeroconf-discovery config flow (I stumbled across this when adding an aircon unit, which happened to have an IP of x.x.x.21, when I already had a unit added with IP x.x.x.213).

I think the IP-substring bug might be the same problem mentioned in this comment? https://community.home-assistant.io/t/mitsubishi-wf-rac-smart-m-air/447917/3

In my case, the "host already configured" error message was not being displayed because it was added to the form with the CONF_HOST key, and in the auto-discovery config flow that field doesn't exist, so no error was shown! I have worked around that by factoring out the common code and having it check if a given field is in the form schema, if not it will just use CONF_BASE.

jeatheak commented 1 year ago

Ow nice that you did look at the config flow mechanics. It was the first ever config flow I did write and because python is not my main language it will contain mistakes.

It looks good and I wil merge the PR. Thanks for your effort.