Danielhiversen / PyXiaomiGateway

PyXiaomiGateway
MIT License
152 stars 55 forks source link

Fix usage of uninitialized discovery_retries #150

Closed karlkar closed 5 years ago

karlkar commented 5 years ago

Sorry guys for doing it in two parts, however I've been thinking on it and in fact @syssi was right - it was not always providing proper value from the config. Now it looks much better. Could you check it @Danielhiversen ?

Also there's one thing worth considering - we added discovery_retries parameter to every gateway's configuration, while there's already discovery_retry parameter in main HA xiaomi_aqara config. So looks like we have "almost" name collision. Shouldn't we change the param name to something more descriptive? device_discovery_retry and in HA main config gateway_discovery_retry?

syssi commented 5 years ago

I prefer device_discovery_retries at platform level of the configuration. We don't need an individual configuration per gateway. Please feel free to submit additional PRs. :-)