ESPHome Error - API Password

Following the most recent HA update, I got the message about API password deprecation. However I got the following error message when trying to re-compile my device code. Anyone got any ideas?

Found the answer Error: Please upgrade to the PlatformIO Core 6 · Issue #3700 · esphome/issues · GitHub
This was the first time in a long time I’d had to re-compile so hadn’t come across this issue. Followed the fix and all good.