def METHOD_NAME():
    logger.log("Polling BMW Connect")
    for thing in myThings():
        if thing.thingClassId != accountThingClassId:
            continue
        account = accountsMap[thing.id]
        try:
            account.update_vehicle_states()
        except:
            logger.warn(f"Error refreshing vehicle states for account {thing.name}")
        for vehicle in account.vehicles:
            logger.log(f"Updating vehicle with VIN {vehicle.vin}")
            thing = findByParam(
                vehicleThingClassId, vehicleThingVinParamTypeId, vehicle.vin
            )
            thing.setStateValue(
                vehicleBatteryLevelStateTypeId,
                vehicle.status.charging_level_hv,
            )
            thing.setStateValue(
                vehiclePluggedInStateTypeId,
                vehicle.status.connection_status == "CONNECTED",
            )
            thing.setStateValue(
                vehicleChargingStateStateTypeId,
                "charging"
                if vehicle.status.charging_status == ChargingState.CHARGING
                else "idle",
            )