WeMos D1 Mini WiFi status constants reversed

To connect to my WiFi I must use this code:

    Serial.println(WiFi.status());
    WiFi.begin(ssid, password);
    
    while (WiFi.status() != WL_DISCONNECTED)
    {
      delay(200);
      Serial.print(".");
    }

Not that WL_DISCONNECTED is used rather than WL_CONNECTED.
The Serial.print before the WiFi.begin shows 3 which I understand to be WL_CONNECTED.
What's going on??

The ESP8266 stores the last known WiFi config, even when a new sketch is uploaded, and reconnects to that at boot.
I think WiFi.setAutoConnect(false); stops that.
Leo..