AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.58k stars 403 forks source link

The SonoffLan integration does not detect wrong (changed) eWeLink password #1436

Closed KaloyanNaumov closed 1 week ago

KaloyanNaumov commented 1 week ago

I've had to change my eWeLink password, and the integration stopped working.

The debug log has this message:

    "errors": [
      {
        "name": "custom_components.sonoff",
        "message": [
          "Can't login in auto mode: AuthError('password error!')"
        ],
        "level": "WARNING",
        "source": [
          "custom_components/sonoff/__init__.py",
          184
        ],
        "timestamp": 1718953555.1565053,
        "exception": "",
        "count": 2,
        "first_occurred": 1718953362.9858747
      }

I found a way to change the pass through "core.config_entries" But the UI should better capture this and expose credential change fields. I also think it's generally good if we have the option to change the username and the credentials all the time.

AlexxIT commented 1 week ago

Just setup new integration with same username and new password. There is impossible to change username.

https://github.com/AlexxIT/SonoffLAN/blob/a3d4cb2d922a0512bdb1ecb4bb6a45a71e2d8409/custom_components/sonoff/config_flow.py#L58-L64