Squachen / micloud

Library for connecting to xiaomi cloud.
MIT License
156 stars 20 forks source link

diffrentiate accesdenied error #2

Closed starkillerOG closed 3 years ago

starkillerOG commented 3 years ago

diffrentiate between socket errors and accesdenied errors in order to appropriatly hadel then upstream (in HomeAssistant).

Upstream in HomeAssistant: When the Pi reboots the internet connection can still be down on first setup of the Xiaomi Miio integration, this causes a socket error in the micloud login request, in that case we want to raise PlatformNotReady and retry after a delay. If however the credentials are wrong, we want to raise AccesDenied to trigger a reauthentication flow to specify new credentials.