v1.2.1
Fixes:
- Fix cloud API failures (e.g. an expired token) being silently treated as empty data instead of a real error, in three places: device state refresh, the config flow's device list, and the options flow's device list. The account previously looked like it had "no devices" or the setup just failed generically instead of correctly triggering reauthentication.
- Fix a second BLUETTI account authenticating through a fresh "Add Integration" flow silently merging into (and overwriting the token of) an already-configured account's entry - it now correctly rejects as already configured. Also fix bind_devices()'s response never being checked, so a rejected device bind (nonzero msgCode) was treated as success in both the config flow and the options flow.
- Fix entry.data["products"] caching every product on the account instead of just the ones actually selected (in the config flow's create/merge paths and the options flow's add-devices path) - a device left unselected the first time would, when added later, reuse this stale cached metadata instead of a fresh fetch.
- Fix a device unbind: the coordinator was torn down and the unbind marked complete before the removal was actually persisted to the config entry - a persistence failure left the device "enabled" forever with no coordinator and no retry path. Persistence now runs first; the unbind notification also now says so honestly instead of always claiming success.
- Fix the OAuth access token not being guaranteed fresh before it's handed to the cloud/websocket clients at setup (the call that ensures this had been commented out), and fix the first refresh of each device's coordinator not waiting for slower devices when another device fails - they were left running as orphaned background tasks after setup had already moved on.
- Fix the periodic (daily) OAuth token check reporting the token as expired without even attempting a refresh first, and fix it (plus the config flow's reauth path) triggering two reload cycles for a single token update.
- Fix ENUM-type sensors (e.g. inverter state) not declaring their possible values (
_attr_options) to Home Assistant when the cloud provides them. - Fix the estimated battery charge/discharge power sensor being silently dropped for EBOX-EP2000 after an over-eager restriction to Balco260 only - both models' real diagnostics data support the same estimate.