audiconnect / audi_connect_ha

Adds an audi connect integration to home assistant
MIT License
227 stars 98 forks source link

fix: External Power `Unavailable` #380

Closed coreywillwhat closed 5 months ago

coreywillwhat commented 5 months ago

"External Power" sensor returns the val of "Unavailable". This leads HA to believe the sensor is unavailable and does not report the sensor as active.

2024-04-11 06:00:02.277 DEBUG (MainThread) [custom_components.audiconnect.audi_models] Found and appended state with timestamp: name=externalPower, tsoff=-1, loc=['charging', 'plugStatus', 'value', 'carCapturedTimestamp'], val=unavailable, ts=2024-04-10 22:48:14+00:00

This PR corrects this by translating unavailable to Not Ready.

Future Changes

A lot of these sensors should be changed to binary sensors, but if we go ahead and change them now, the old sensor will remain as a duplicate. We need to figure out migration and/or I think the different entities should have unique ID's so HA can recognize them as the same.